Bug Fix: Fixed regression that resulted in a false positive error when using an index expression form with a class whose metaclass supplies a __getitem__
method when the expression is used as a runtime expression, as opposed to a type expression.
Performance: sped up type analyzer by 5-25% by caching types that have been converted to or from an instance. This drops the analysis time of pydantic from 17s to 12s.
Performance: Further improved perf when determining type compatibility of unions with many subtypes. This further reduces the analysis time of pydantic from 12s to 4s.
Enhancement: Added new diagnostic check reportImplicitOverride
.
Bug Fix: Fixed bug that resulted in a false positive error relating to variance incompatibility.
Bug Fix: Fixed regression that caused a crash in the presence of the illegal statement import .
.
Behavior Change: Changed the logic in the code flow engine so it never attempts to infer a NoReturn return type for a function that lacks a return type annotation. This results in a big speed improvement for some (unannotated) code bases, but it also produces somewhat inconsistent type evaluation results because a function whose type is inferred to be NoReturn by the type checker will not be treated as such if it is called elsewhere in the program.
Bug Fix: Fixed bug that resulted in a crash when user types import
without a follow-on module name. This can happen in due corse of typing an import statement.
Bug Fix: Added support for clear
and popitem
methods on TypedDict instance that is marked @final
and has no required entries.
Bug Fix: Improved hover text for methods that are synthesized (e.g. the get
method for TypedDict).
Behavior Change: When stub generator encounters an import statement within a try block, it now emits it rather than ignoring it.
Bug Fix: Fixed a bug that can result in infinite recursion (and a subsequent crash) when a class instance is called and the class defines a __getattr__
method.
Enhancement: Added support for @deprecated
in an __init__
method when constructing a class.
Bug Fix: Fixed a couple of bugs in the type narrowing logic for class pattern matching. In particular, added better support for NoneType()
patterns and cases where the subject type is a union that includes subtypes of the class pattern.
Behavior Change: Improved consistency of type narrowing on assignment when the target is a variable with a declared type and the assigned value is an unknown or partially-unknown type. Previously, if the assigned value was Unknown, the declared type was assumed, but if the assigned value was a union that included Unknown, the narrowed type (including the Unknown) was assumed. We now always include an Unknown
in the assigned type so the reportUnknownVariableType
diagnostic is reported.
Enhancement: Updated typeshed stubs to the latest version.
Bug Fix: Fixed a bug that led to the incorrect type resolution for unsupported function Enum class construction. The resulting type should be Unknown
, but it was evaluated as Never
.
Enhancement: Extended support for reportUnnecessaryComparison check to handle dataclass types that use a synthesized __eq__
method.
Bug Fix: Fixed regression that resulted in internal corrupt state and odd behaviors like builtin symbols being marked as "not found" in some circumstances.
Bug Fix: Fixed a recent regression that resulted in a false positive error when a multi-part import statement was used and useLibraryCodeForTypes
was disabled.