Bug Fix: Added missing checks for an attempt to modify a variable that has been marked "Final" using a means other than a simple assignment statement. This includes augmented assignments, tuple assignments, for statements, with statements, assignment expressions, etc.
Behavior Change: Modified parameter type inference logic to not infer a parameter's type based on the default argument value if the value is a tuple, list, set or dict.
Enhancement: Improved type evaluation of type(x)
to handle the case where x
is a union type.
Bug Fix: Fixed bug that caused false negative when a class defined a __getattr__
method but no __getitem__
method and a subscript expression was used with a class instance.
Bug Fix: Fixed a bug in the logic that determines whether a class that derives from a protocol implements all of the functions and variables within that protocol. It wasn't considering mix-in classes.
Bug Fix: Fixed regression in "finally" type analysis that allowed type violation errors to go unreported in finally clauses.
Behavior Change: Changed the behavior of type evaluator when it encounters an unannotated symbol within a "py.typed" source file. Previously, it did not fall back on type inference and instead evaluated the type as "Unknown". It now falls back on type inference but internally marks the type as "ambiguous". Added logic to detect "likely ambiguous inferences".
Behavior Change: Updated package type verifier to differentiate between "unknown" and "ambiguous" types.
Bug Fix: Fixed a bug in type evaluator that resulted in a crash when a function signature contains a "**" parameter with no name.
Bug Fix: Fixed a bug that resulted in a crash due to infinite recursion.
Bug Fix: Enhanced parser to detect extremely deep parse trees created from index or member access expressions. The parser now emits an error rather than allowing the type evaluator to crash (with a stack overflow) in such situations.
Enhancement: Updated typeshed stubs to the latest.