npm pyright 1.1.319
Published 1.1.319

latest releases: 1.1.381, 1.1.380, 1.1.379...
14 months ago

Bug Fix: Fixed a bug that results in a crash when attempting to use a member access expression where the LHS is a TypeVarTuple.

Bug Fix: Fixed a bug that led to a false negative when analyzing code with an async context manager that swallows exceptions.

Enhancement: Improved error messages for situations where a call expression targets an overloaded function or method and there are no matches. Added some heuristics to pick the "best" overload function for the error message. Previously, pyright used the last overload, but this sometimes led to confusing errors.

Enhancement: Added support for the X is C and X is not C type guard pattern (where C is a class).

Bug Fix: Fixed an issue in type evaluation of call expressions where the callable subexpression evaluates to a union, and the callable subtypes have different signatures. Pyright was previously caching the types from the first subtype, so it didn't re-evaluate using the second subtype (which may require bidirectional type inference).

Bug Fix: Fixed bug in hover text where it was not producing the correct text output for an instantiable callable.

Enhancement: Added detection and reporting of illegal use of type[Callable] within a type annotation.

Bug Fix: Fixed a bug that resulted in a false positive error when bidirectional type inference was used with a class that defines a __new__ method within a generic class that returns an instance of the class whose type arguments do not match the type parameters.

Bug Fix: Fixed an inconsistency in reporting of unbound variables when the variable is captured by an inner scope. The new behavior correctly identifies unbound (or potentially unbound) variables in cases where the captured variable is narrowed. This happens when there are no assignments to the variable after it is captured.

Bug Fix: Fixed a bug that led to a false positive when a constrained type variable was used as a type argument in an annotation for an argument passed to a method that's bound to the same type variable.

Bug Fix: Improved robustness of handling of circular dependencies for class evaluations.

Enhancement: Enhanced support for functools.partial so it supports classes (constructors) when passed as the first argument.

Bug Fix: Fixed a bug that led to a false positive error when using bidirectional type inference for a dictionary expression when the expected type is a protocol.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed a bug that led to a hang and eventual crash (due to memory exhaustion) under certain circumstances where a function returns a generic Callable whose type parameters are not used in the input parameters for the function.

Bug Fix: Modified the heuristics used for narrowing on assignment when the assigned type contains an Any. If the target's declared type does not contain Any, the assignment shouldn't produce an Any within the resulting type.

Enhancement: Added support within the constraint solver for higher-order functions that accept a callable parameterized with a ParamSpec where the passed callable is generic.

Bug Fix: Fixed a bug that resulted in the incorrect inferred variance for a type variable used within a frozen dataclass.

Bug Fix: Fixed a theoretical bug in the code that detects unique type signatures. It wasn't correctly handling constructor methods.

Bug Fix: Added support for type narrowing of a class pattern when the specified class is type() or a subtype thereof and the subject contains a type[X] whose metaclass potentially matches the pattern.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.