Skip to content

Published 1.1.325

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Aug 02:41
· 868 commits to main since this release

Bug Fix: Fixed a bug in the isinstance type guard logic that produced incorrect results when narrowing a generic class instance.

Bug Fix: Fixed a bug in the parser that led to a false positive syntax error when a match statement was followed by a - or ~ token.

Bug Fix: Improved logic that determines whether an object is callable. The __call__ attribute must be a class variable, not an instance variable.

Bug Fix: Improved isinstance and issubclass narrowing in the case where an intersection type is created and one of the two subclasses has a custom metaclass.

Behavior Change: Changed type evaluation behavior for a class variable that uses Self in its type definition. When accessed via a subclass (either through cls or self), the type is now assumed to be changed to Self of the child class. This makes pyright's behavior closer to mypy's in this case.

Bug Fix: Fixed regression that resulted in incorrect type evaluation and a spurious reportUnknownArgumentType error when calling the same constructor multiple times in a single call expression.

Bug Fix: Fixed a bug that caused a "py.typed" marker file to be ignored in a namespace package if the marker file is at the same directory level as the submodule being imported leading to a spurious reportMissingTypeStubs error.

Bug Fix: Fixed a bug that led to a false positive during overload matching when the arg type includes a union where one of the subtypes is a constrained TypeVar.

Enhancement: Added a new configuration option deprecateTypingAliases that enables deprecation detection and reporting for symbols imported from the typing module that are deprecated according to PEP 585 and 604. The option is currently disabled by default (even in strict mode) but can be enabled manually.

Behavior Change: Changed logic to exempt abstract overloaded methods within an ABC so an implementation is not required.

Bug Fix: Fixed check for illegal use of zero-argument super within an inner function located within a method.

Bug Fix: Fixed a bug that led to a false negative when a type annotation contains a stringified type on the LHS of an index expression.

Enhancement: Added support for @type_check_only decorator.

Enhancement: Improved error message for type incompatibility when type parameter is covariant or contravariant.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed a bug that led to incorrect type evaluation and false positive errors when a function with a ParamSpec was passed to another function with a ParamSpec.

Behavior Change: Changed interpretation of ... forms of tuples to improve consistency and match mypy's behavior. The type tuple[int, ...] is now interpreted as the union of all tuples of length zero or more that contain only int. Because this is a union, assigning a value of this type to a tuple type with a known (specified) length is now considered a type violation.

Bug Fix: Fixed several bugs in the logic for "strict type guard" positive and negative type narrowing.

Bug Fix: Fixed long-standing bug that caused various problems (including poor performance, incorrect type evaluations, and false negatives and false positives) when calling a constructor for a generic class within the class implementation.

Bug Fix: Fixed a bug that led to a false positive reportUnusedVariable error when a dynamic expression was used in a namedtuple call argument.

Bug Fix: Fixed a bug that led to a false positive reportIncompatibleMethodOverride error when a function-scoped type variable was used in a contravariant position.

Bug Fix: Fixed bug that led to the incorrect type evaluation when calling a generic function and a value of type P.args or P.kwargs is assigned to a type variable.

Bug Fix: Fixed a bug that led to a false negative error for an expression used within an f-string within a loop.