npm pyright 1.1.401
Published 1.1.401

latest releases: 1.1.407, 1.1.406, 1.1.405...
7 months ago

Bug Fixes:

  • Fixed a bug in the type narrowing logic for the S in D type guard pattern (where S is a string literal and D is a TypedDict). If the TypedDict is not closed, the absence of the key within the TypedDict definition cannot eliminate the type during narrowing.
  • Fixed a bug that leads to a false negative when accessing a key on a TypedDict that is defined with extra_items=Never.
  • Fixed bug that results in incorrect variance inference when a property access method uses a method-local type variable to annotate the self parameter.
  • Fixed bug that results in a false positive error under certain circumstances where the second argument for a super call is a union.
  • Fixed bug that results in a false negative when deriving from a stdlib protocol class and not implementing one or more abstract methods.
  • Fixed bug that results in incorrect type narrowing behavior when the second argument to an isinstance call includes a union (specifically with the | operator) within a tuple expression.
  • Fixed a bug that results in a spurious error when __class__() is assigned to Self.
  • Added missing check for unquoted self references when calling TypeAliasType constructor manually (as opposed to using the PEP 695 type syntax).
  • Fixed a bug that results in incorrect expansion of the bytes promotion type if the value is a bytes literal.
  • Fixed bug in type narrowing logic for class patterns in a match statement. Negative type narrowing was incorrect when the subject is a literal type and the class is the corresponding non-literal class.

Enhancements:

  • Improved handling of __slots__ members to correctly model the case where a descriptor object is stored in a __slots__ variable.
  • Modified --verifytypes output to expand type aliases in its error messages to help diagnose "partially unknown" conditions.
  • Enhanced x is ... type narrowing logic to narrow Any | EllipsisType to EllipsisType to match x is None narrowing logic.
  • Updated typeshed stubs to the latest version.

Behavior Changes:

  • Switched internal usage of builtins.function, typing.AwaitableGenerator, and typing._TypedDict to types.FunctionType, _typeshed._type_checker_internals.AwaitableGenerator, and _typeshed._type_checker_internals.TypedDictFallback, respectively.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.