github microsoft/pyright 1.1.305
Published 1.1.305

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

Bug Fix: Fixed a bug that resulted in incorrect type comparison results (which led to incorrect type narrowing) when Annotated was used in some circumstances.

Bug Fix: Fixed bug that led to a false positive error when a ParamSpec captures a signature that includes an *args or **kwargs and then is called using an unpacked iterable (for *args) or an unpacked Mapping (for **kwargs).

Enhancement: Added diagnostic for # pyright comment that controls file-level settings that is not on its own line (i.e. doesn't start in column 1).

Bug Fix: Fixed bug that resulted in a false positive error when importing a type alias via a wildcard import.

Bug Fix: Fixed bug in inference of generator function return type that led to false positive error. The "send" type (the second of three type arguments for a Generator) cannot be inferred precisely, so it should be Unknown rather than None. Modified the "send type" type inference logic for generators. Instead of always inferring Unknown, pyright now infers Any if the send type is provably never used within the generator. This is a common case and allows the generator function return type to be inferred without an Unknown partial type in most cases.

Bug Fix: Fixed a bug that led to a false positive error when a partially-specialized generic function with a ParamSpec is further specialized such that the ParamSpec is bound to ... (i.e. the ParamSpec equivalent of Any).

Enhancement: Improved handling of bidirectional type inference for call expressions in the case where the target call returns a callable and the expected type is a union that includes some non-callables. The logic now filters out the non-callables to enable bidirectional type inference to succeed in cases where it previously didn't.

Bug Fix: Fixed a type evaluation bug involving the tuple constructor call when used with bidirectional type inference, specifically when the expected type is a union of tuples.

Enhancement: Updated typeshed stubs to the latest version.

Enhancement: Improved error message for binary operators that don't use union expansion.

Bug Fix: Fixed a bug that resulted in a false positive "is partially unknown" error when using an overloaded function whose implementation was partially unknown. Only the overloads should be considered in this case.

Behavior Change: Changed reportUninitializedInstanceVariable check to exempt subclasses of ABC that are not marked @final. It already exempted Protocol classes.

Bug Fix: Fixed type evaluation bug that led to a false positive in cases involving bidirectional type inference of a constructor whose type variable is invariant and the argument is a dictionary, set, or list expression.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.