Enhancement: Added check for an attempt to instantiate a protocol class. This causes a runtime error.
Behavior Change: Closed a hole in type narrowing for "in" operator when used with TypedDict. It can eliminate types from a union only if the type is marked final.
Enhancement: Changed type printer to handle recursion differently — most notably when dealing with recursive type aliases. If it is asked to expand type aliases, it now expands only the first level of a given type alias, so if there's recursion, it will use the type alias name the second time it is encountered rather than continuing to expand it.
Enhancement: Changed reveal_type
and reveal_locals
to expand type aliases in their output.
Bug Fix: Fixed bug that resulted in incorrect type checking behavior when a type annotation involved a tuple with literal elements.
Bug Fix: Fixed bug that affected the handling of a function decorator that uses ParamSpec when applied to a classmethod or staticmethod.
Enhancement: Added diagnostic for an attempt to instantiate a special type like a Union, Callable, or Optional.
Bug Fix: Improved support for generic functions that annotate a parameter and a return type with a union that includes a TypeVar. In such cases, the TypeVar may not be matched during constraint solving.
Enhancement: Improved hover text for type variables and param specs by updating the label so they are not shown simply as type aliases.
Enhancement: Updated to the latest typeshed stubs.