Skip to content

Published 1.1.116

Compare
Choose a tag to compare
@erictraut erictraut released this 01 Mar 07:24

Enhancement: Improved type inference logic for tuple expressions that contain unpacked tuples.

Bug Fix: Fixed bug that resulted in unknown types within stubs when a forward reference was made within a type alias definition.

Bug Fix: Fixed bug in bidirectional type inference logic for unpack operator.

Bug Fix: Fixed bug in assignment type narrowing for index expressions. The narrowed type was always evaluated as "None" rather than the assigned type.

Bug Fix: Fixed bug in assignment type narrowing that was triggered when the RHS and LHS were both union types and the RHS contained an Any.

Enhancement: Added diagnostic check for a call expression that appears within a type annotation. This was previously not flagged as an error.

Bug Fix: Fixed false negative bug in the "reportOverlappingOverload" diagnostic check. It was not correctly detecting overlapping overloads when one of the parameters in the earlier overload was annotated with at TypeVar.

Bug Fix: Fixed bug in logic that compares the type compatibility of two functions. In particular, if the source function contains a keyword argument and the dest function does not contain a keyword argument of the same name bug contains a **kwargs, the types must match.

Enhancement: Added support for overloaded __init__ method that annotates the self parameter with a generic version of the class being constructed.

Behavior Change: Added a few exemptions for the reportInvalidTypeVarUse check. In particular, constrained TypeVars, bound TypeVars used as type arguments, and any TypeVar used as a type argument to a generic type alias are exempt from this check. There are legitimate uses for all of these cases.

Bug Fix: Fixed recent regression in type assignment check logic that broke certain cases where the destination and source were both unions that contained type variables.

Behavior Change: Changed behavior when evaluating type of symbol within type stubs. Previously forward references were allowed only for class types. Now, forward references are allowed (and no code flow analysis is employed) for all symbols. The new behavior is consistent with mypy's.

Enhancement: Added new diagnostic check for an overloaded function without an implementation within a source (.py) file. Fixed a bug in the diagnostic check for a single overload when an implementation is present.

Bug Fix: Fixed bug in the parsing of "with" statements where the "with item" starts with an open parenthesis.

Enhancement: Added "collections.defaultdict" to the list of classes that does not support runtime subscripting in versions of Python prior to 3.9.

Behavior Change: Changed behavior of type inference for empty list ([]) and empty dict ({}) expressions. They were previously inferred to be List[Any] and Dict[Any, Any], but they are now inferred as List[Unknown] and Dict[Unknown, Unknown]. This affects strict mode type checking, where partially-unknown types are reported as errors. This change may require some explicit type annotations within strictly-typed code.