Skip to content

Published 1.1.324

Compare
Choose a tag to compare
@github-actions github-actions released this 23 Aug 00:52
· 1566 commits to main since this release

Bug Fix: Fixed a bug that led to a false positive error under certain circumstances when a callable using Concatenate is assigned to another callable using Concatenate.

Bug Fix: Fixed bug that can result in a false positive error when a wildcard import targets a module that doesn't contain a __all__ definition but includes dundered names in its module namespace.

Bug Fix: Fixed a false positive error when invoking a call of a variable that is annotated using a PEP 695 type alias.

Bug Fix: Fixed a bug that caused an incorrect application of a ParamSpec in certain cases where the signature bound to the ParamSpec was generic.

Enhancement: Improved validation of NamedTuple and namedtuple factory calls.

Enhancement: Improved detection of redundant pattern capture targets in case statements.

Bug Fix: Changed the type evaluation logic for the enum value member so a custom value type can be specified in the Enum subclass.

Bug Fix: Fixed a bug that led to a false positive in the reportIncompatibleMethodOverride check in certain circumstances where the method in both the base class and child class are overloaded.

Bug Fix: Fixed bug that resulted in a false positive error when an async function with no return type annotation was called recursively.

Bug Fix: Fixed a bug that led to a false positive in the reportIncompatibleMethodOverride check when overriding a method with a ParamSpec.

Bug Fix: Fixed a recent regression that resulted in a false positive during protocol matching if the protocol defines an __eq__ method but doesn't include a __hash__ definition.

Bug Fix: Fixed bug that sometimes led to false positives or false negative in call expressions that involve keyword arguments followed by an unpacked.

Bug Fix: Fixed a bug that resulted in the incorrect textual form (used in error messages) for a generic class with a ParamSpec that is parameterized with ....

Bug Fix: Fixed regression that caused a spurious error with the reportIncompatibleMethodOverride check when a method with a ParamSpec was overridden by a method with *args: Any, **kwargs: Any.

Bug Fix: Fixed a bug that led to incorrect type narrowing on assignment in certain cases.

Enhancement: Added check for classes that have mutually-incompatible base classes due to generic type argument mismatches.

Bug Fix: Fixed bug that led to a false positive reportIncompatibleVariableOverride error when overriding a synthesized __hash__ symbol.

Bug Fix: Added heuristic to constraint solver logic to better handle the case where a parameter is annotated with a union of multiple "bare" TypeVars (like S | T). In this case, it's not clear whether the corresponding argument type should constrain S or T or both. We now defer the constraint during the first pass of arg/param type validation so additional references to S or T can help establish the appropriate constraint.

Bug Fix: Fixed a bug that led to incorrect type evaluation of Union[*Ts] (where Ts is a TypeVarTuple) in certain situations

Bug Fix: Fixed bug that resulted in incorrect type evaluation when passing a generic class as a Callable parameter more than once in the same call.

Enhancement: Added logic to mirror the (rather surprising) runtime behavior when an attribute is accessed from a class object and the metaclass defines an attribute of the same name that happens to be a descriptor object. The runtime favors the metaclass attribute in this case.

Enhancement: Extended inlined TypedDict prototype to support TypedDict as well as dict so we can compare the two proposals.

Bug Fix: Changed logic for handling the __get__ method of a descriptor so pyright more accurately models the runtime behavior when the descriptor is accessed through an object (as opposed to a class). Previously, pyright was modeling this as an Any value to avoid problems with type stubs that are not accurately modeling the runtime behavior, but this caused other unintended side effects.

Bug Fix (from Pylance): Fixed bug that led to internally-corrupted type state if the language server canceled a type evaluation request at just the wrong time.

Enhancement: Added logic to handle the case where a declared return type of a function includes a constrained TypeVar and a return statement is guarded by a case statement using a class pattern that guarantees that the constraint is met on that code path.