Bug Fixes:
- Fixed bug that results in a false positive error under certain circumstances involving a call to a higher-order generic function with another function that involves a class with a contravariant type variable.
- Fixed bug that results in a confusing error message when stub generation fails.
- Fixed bug that results in false positive when evaluating the call to a generic function that involves a type variable used in both a covariant and contravariant (or invariant) position and both literal and non-literal types are involved.
- Fixed bug that results in a false negative when solving a type variable that involves an invariant context.
- Fixed a bug that can result in incorrect type inference for a subexpression that is part of an assignment expression if executed with an inference context (bidirectional type inference).
- Fixed bug in
x is E
type narrowing pattern whereE
is an enum literal andx
is a supertype ofE
likeobject
.
Behavior Changes:
- Changed behavior of constructor call evaluation when
__new__
evaluation results in type evaluation errors. Previously, pyright skipped the__init__
evaluation in this case. It now proceeds to evaluate__init__
, potentially generating redundant errors. - Removed support for inlined TypedDict annotations. This was an experimental feature that never gained enough support to make it into a PEP.
- Changed behavior of pyright to match the latest typing spec when it encounters an attribute with a type annotation within an
Enum
class body in a stub. These are now treated as non-member attributes rather than members. Typeshed stubs have been updated to conform to the new standard. - Added diagnostic check for an enum member with a type annotation. The typing spec says that this should be considered a typing error.
Enhancements:
- Updated typeshed stubs to the latest version.