github microsoft/pyright 1.1.345
Published 1.1.345

latest releases: 1.1.381, 1.1.380, 1.1.379...
8 months ago

Bug Fixes:

  • Fixed bug that led to false negative when a list expression was used within the first type argument of an Annotated type expression.
  • Added a missing error condition for a non-method function that is marked @final.
  • Fixed crash related to a regression introduced with recent internal URI tracking.
  • Fixed false negative for a TypeVarTuple constructor call that includes value constraints.
  • Fixed a bug that led to an incorrect type evaluation for an explicitly-specialized class parameterized with a ParamSpec.
  • Fixed bug that resulted in incorrect type evaluation when a PEP-695 TypeVar is shadowed by an identifier of the same name within an inner scope.
  • Added missing check for inconsistent use of @final in an overloaded function. Added missing check for override of an overloaded method marked @final.
  • Fixed bug in protocol matching logic to reject a protocol match if a variable is a ClassVar in the protocol but not in the concrete class (or vice versa).
  • Fixed bug that leads to a false positive when a generic property is defined within a protocol.
  • Fixed a bug that led to incorrect type evaluation when a constrained TypeVar includes literal types as constraints.
  • Added missing check for the specialization of a generic type alias that includes a TypeVarTuple plus two or more TypeVars.
  • Fixed a bug that resulted in a false negative when specializing a generic type alias parameterized by a regular TypeVar with an unpacked tuple.
  • Added missing error for an illegal unpacked argument in type argument list.
  • Fixed a bug that led to a duplicate error message when defining a class-scoped type alias.

Enhancements:

  • Improved error message for protocol classes that derive from non-protocol classes.
  • Improved error reporting for incompatible overrides.
  • Added code to report when the Concatentate special form is used in an illegal context.
  • Added support for constants for field names in NamedTuple call.
  • Improved evaluation logic for tuple slices. It now works in cases where the tuple includes unbounded entries or unpacked TypeVarTuples.
  • Improved type analysis performance in certain cases involving complex code flow graphs and "truthy" conditional statements.
  • Added check for a call to an unimplemented method in a protocol from a base class that explicitly calls it.
  • Implemented small performance improvement by not generating error messages during protocol TypeVar variance validation.
  • Added check for data protocols used in an issubclass call. PEP 544 indicates that this isn't allowed.
  • Added check for "unsafe overlaps" for a runtime-checkable protocol when used in an issubclass or isinstance check.

Behavior Changes:

  • Changed CLI to sort diagnostics by location within a file.
  • Removed support for Union[*Ts] and Union[*tuple[...]]. This functionality was included in an early draft of PEP 646 but was dropped in the final spec. The functionality can still be used in pyright if useExperimentalFeatures is set to true, but it will likely be removed entirely in the future.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.