Skip to content

Published 1.1.333

Compare
Choose a tag to compare
@github-actions github-actions released this 25 Oct 03:14
· 651 commits to main since this release

Bug Fix: Fixed a bug that resulted in a false negative when assigning one TypedDict to another TypedDict. Field types should be treated as invariant rather than covariant because they are mutable (unless marked readonly).

Enhancement: Improved the synthesized update method for TypedDict classes so it supports keyword arguments and iterables of tuples.

Bug Fix: Improved error message for protocol mismatch when a method in the source cannot be bound.

Performance: Added performance improvement that speeds up type checking for TypedDict classes that have a large number of entries.

Bug Fix: Fixed a bug that led to a false positive when doing protocol matching for a protocol that uses deeply nested recursion.

Bug Fix: Fixed a bug that resulted in incorrect narrowing on assignment when the assigned type is a tuple that includes one or more Any type arguments and the declared type is a tuple without an Any.

Bug Fix: Fixed a bug that led to a false positive error when doing protocol matching for a protocol and implementation that use a combination of class-scoped and function-scoped TypeVars.

Bug Fix: Fixed several bugs in ReadOnly TypedDict functionality based on the latest draft of the PEP 705.

Enhancement: Extended the len(x) == L type guard logic to support arbitrary expressions L that evaluate to a literal int type.

Behavior Change: Removed support for readonly keyword parameter for TypedDict to reflect latest changes in PEP 705.

Bug Fix: Fixed bug in protocol matching when source is a namedtuple or a frozen dataclass. Algorithm wasn't taking into account that attributes in these classes are immutable.