Skip to content

Published 1.1.210

Compare
Choose a tag to compare
@erictraut erictraut released this 16 Jan 18:00
· 3412 commits to main since this release

Behavior Change: Removed support for two-argument form of TypeGuard including support for "type asserts". The feedback on this idea was relatively negative.

Enhancement: Added provisional support for a proposed StrictTypeGuard feature. For details, refer to this discussion.

Enhancement: Added support for old-style (pre-await) coroutines.

Bug Fix: Fixed a bug that resulted in a false positive in cases involving bidirectional type inference with an expected callable type where one or more of the parameter types was a tuple with non-literal element types and the provided argument was a tuple with a literal value.

Bug Fix: Improved limit check for literal math.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug that results in false positive when using a super().__init__ call within a metaclass __init__ method.

Bug Fix: Fixed bug that results in a false positive error when using yield within the outermost iterator of a list comprehension.

Bug Fix: Fixed a bug that resulted in a false positive when importing OrderedDict from typing_extensions. Added a mechanism for loading typeshed modules on demand within the type evaluator, including collections/__init__.pyi which declares the real OrderedDict class.

Enhancement: Added improved checks for size mismatches when unpacking known-length iterables into a list target (like [a, b] = (1, 2, 3)).

Behavior Change: Changed the setdefault method generated for TypedDict classes so it accepts only literal key values. Fixed a bug in the get method generated for TypedDict classes so it accepts arbitrary values for the default value parameter.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when using a generic type alias that consists of a union of multiple type variables that are filled with the same type when the type alias is specialized.

Behavior Change: Modified the reportMissingSuperCall diagnostic based on feedback. It now emits an error for classes that include an __init__ and don't call through to super().__init__ even if that class derives from object, unless it's marked @final.