Published 1.1.218
Enhancement: Allow "--watch" to be used in conjunction with "--outputjson" command-line options.
Enhancement: Added support for bidirectional type inference for yield
statements. The expected type is based on the first type argument in a Generator
or AsyncGenerator
return type annotation.
Enhancement: Added the ability to add new symbols to builtins
by simply adding a type stub file named __builtins__.pyi
locally.
Bug Fix: Fixed a bug that led to a false positive error when handling bidirectional type inference for tuple expressions when the expected type was a union that contained multiple tuple subtypes.
Bug Fix: Fixed a bug that resulted in a false negative when a list comprehension was used within a class body and referenced a class-scoped variable in a subexpression other than the first iterable. This also fixes a similar bug where a lambda was used within a class body and referenced a class-scoped variable in its return expression. These now property generate errors, reflecting the runtime behavior.
Bug Fix: Fixed a bug that resulted in incorrect type inference for positional parameters used in class patterns if the corresponding class was defined in a "py.typed" library and it defined a __match_args__
symbol with no annotation.
Bug Fix: Fixed bug in stub generator that caused it to omit import statements with multi-part names (e.g. import a.b.c
) even though there was a reference within the generated stub to the imported module.
Enhancement: Extended type narrowing for class pattern matching so it supports narrowing in the negative case when arguments are present and when the pattern class is generic.
Bug Fix: Fixed a bug that resulted in a false negative when a *args
parameter was used in conjunction with a *
keyword-only separator parameter. This generates a syntax error at runtime.
Bug Fix: Fixed a false positive error when TypeGuard
was used without a type argument in a runtime manner (outside of a type annotation).
Bug Fix: Fixed recent regression that results in false positive errors detected in the reportUnknownParameterType
diagnostic check when the function includes a parameter with a double underscore name indicating that it's positional-only.
Enhancement: Improved signature help and hover text for synthesized __init__
dataclass method when a parameter uses a field descriptor with a default value.