Behavior Change: Updated the handling of type narrowing for class pattern matching in cases where a class subclasses from one of the special built-in types listed in PEP 634 as treating a single positional argument as matching the entire subject. The behavior of the CPython implementation deviates from the PEP in this manner, but the implementation takes precedent over the spec in this case.
Bug Fix: Fixed a bug that led to false positive errors when evaluating comparison operator overrides (e.g. __eq__
or __lt__
) in cases where the LHS type didn't support the comparison but the RHS type did.
Enhancement: Added logic to exempt a self
with annotated type Never
from the check that verifies the self
type is a subtype of the class.
Bug Fix: Fixed a bug that resulted in an incorrect inferred function return type when one or more of the return statements returned an expression based on an empty container ({}
or []
).
Bug Fix: Fixed a bug that caused a Final
variable to lose its literal value when imported from another file.
Bug Fix: Fixed a bug that resulted in a false positive "overlapping overload" diagnostic in certain cases.
Bug Fix: Fixed a bug that resulted in a false positive diagnostic when using a TypeVarLike with a default value by itself in a function signature.
Bug Fix: Fixed issue that caused the type of None.__class__
to be evaluated incorrectly with new typeshed definition of object.__class__
.
Enhancement: Updated typeshed stubs to the latest.
Enhancement (contribution by Declan Brady): Added parameter documentation on hover from function docString.
Bug Fix: Fixed bug that resulted in incorrect type evaluation when a __new__
is called and is bound to a class that is different from the cls
argument passed to it.