Skip to content

Published 1.1.149

Compare
Choose a tag to compare
@erictraut erictraut released this 14 Jun 20:32
· 4268 commits to main since this release

Bug Fix (from pylance): Fixed crash that can occur when a library is installed in the form of a zip file, and that zip file is malformed.

Bug Fix: Fixed bug that caused false positive error when using a generic type alias as a constructor call.

Enhancement: Added check for illegal use of "async" keyword. The Python interpreter generates a syntax error if it is used outside of an async function.

Enhancement: Tweaked heuristics in constraint solver for dealing with matching of TypeVar T for the type expression Union[T, SomeClass[T]]. There are two valid solutions if the argument is type SomeClass[X], but the "simpler" solution (T = X) should be preferred over the more complex (T = SomeClass[X]).

Bug Fix: Fixed bug in type checker related to the use of a TypeVar or ParamSpec within an inner function when it is already bound to an outer function but used only within that outer function's return type annotation.

Bug Fix: Added error handling for very large source files. This situation is now detected earlier so we don't attempt to load the file contents and crash the language server in the process.

Behavior Change: Added logic to convert Type[A | B] into Type[A] | Type[B], which avoids violating assumptions elsewhere in the type checker.

Enhancement: Updated to the latest version of typeshed, which includes support for ParamSpec in contextlib's contextmanager function.

Bug Fix: Fixed bug in type checker that occurred in some cases when a generic function returned Type[T]. In some cases where an input parameter also had an annotation of Type[T], the "solved" type was wrapped in Type twice (e.g. Type[Type[int]]).

Bug Fix: Fixed bug in type evaluator that occurred when calling a constructor of type Type[T] where T is a constrained TypeVar.

Bug Fix: Fixed bug that resulted in an import being marked as unaccessed if it was accessed within a class declaration but was also redeclared within the class scope.