npm pyright 1.1.373
Published 1.1.373

latest releases: 1.1.388, 1.1.387, 1.1.386...
3 months ago

Bug Fixes:

  • Fixed regression that results in a false positive when an Annotated type is used in a type argument within a specialized type on the LHS of a call expression, such as list[Annotated[int, ""]]().
  • Fixed a bug that results in incorrect type evaluation in certain edge cases involving bidirectional type inference with TypeVarTuples.
  • Fixed a bug that results in a false positive error when using bidirectional type inference for a call expression where the expected type is a union.
  • Added the distinction between "external" versus "internal" type variable scopes. This is important for generic class implementations that call their own constructors.
  • Fixed a bug that results in incorrect type narrowing when using TypeIs form when the return type of the type guard function is a specialized generic class.
  • Fixed bug that results in a false positive "overlapping overload" diagnostic when the later overload includes a callback function with a TypeVar in a parameter type.
  • Fixed bug that resulted in an infinite loop when evaluating a call that passes the same call as an argument. Simplified tracking of unique signatures within the code.
  • Fixed a bug that can cause a hang during type analysis for complex code with loops. There are rare circumstances that can cause types not to converge due to symbol dependencies and unstable overload resolution. This change adds a hard limit on the number of attempts to converge types in a loop before giving up.
  • Fixed a bug that results in false negatives in certain cases involving bidirectional type inference for constructor calls.
  • Fixed issues with the reportInconsistentConstructor. It produced false negatives in some cases and produced bad error messages in other cases.
  • Fixed bug that results in a crash if an explicit specialization of a class parameterized by a ParamSpec has zero type arguments. This is a syntax error, but it shouldn't cause the type evaluator to crash.

Behavior Changes:

  • Changed all diagnostic generated in the type evaluator to have a diagnostic rule associated with them so their severity is under user control.
  • Changed internal behavior to retain type alias information when applying solved type variables for a type. This doesn't change type checking behaviors, but it changes language server output (e.g. hover text) in some cases. It can also affect diagnostic messages.

Enhancements:

  • Added provisional support for draft PEP 736 (keyword argument shortcut syntax).
  • Added check for class attribute type declarations that use method-bound type variables. These should be illegal.
  • Improved type evaluation for tuples index expressions with negative subscripts and an entry with an indeterminate length.
  • Made support for "converter" parameter in dataclass_transform fields non-experimental. This functionality has been approved by the typing council.
  • Added support for bidirectional type inference for __extra_types__ in a closed TypedDict.
  • Updated typeshed stubs to the latest version.
  • Added support for auto-synthesized __replace__ method in dataclass and namedtuple classes, a new feature in Python 3.13.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.