Skip to content

Published 1.1.275

Compare
Choose a tag to compare
@erictraut erictraut released this 12 Oct 05:12
· 2023 commits to main since this release

Bug Fix: Fixed a bug that resulted in an incorrect type evaluation when a TypeVar bound to an Enum class is instantiated.

Bug Fix: Added a global "cache manager" to track heap usage for all type analyzer service instances. This prevents out-of-memory conditions when many roots are used in a multi-root workspace.

Behavior Change (from Pylance): Don't treat classes decorated with dataclass_transform as dataclasses for purposes of determining which fields should be represented in the synthesized __init__ method. This was an ambiguity in PEP 681, which was recently clarified.

Bug Fix: Fixed a bug that resulted in a false negative when using illegal annotation expression forms within a TypedDict inlined (call-based) definition.

Bug Fix: Fixed a bug in the code flow engine that resulted in incorrect type evaluation in certain cases involving nested loops.

Bug Fix: Fixed a bug that resulted in a false positive error when a call targets an object with a __call__ that is itself an object with a __call__ method.

Bug Fix: Added a check for a return statement with an explicit return value within an async generator function. This is considered a syntax error by the Python compiler, so it should be flagged at static analysis time.

Bug Fix: Fixed a bug that resulted in incorrect handling of binary files (e.g. ".so" or ".pyd" files) within a library when creating stub files.

Behavior Change: Enhanced the heuristics used to infer the type of an unannotated function parameter with a default value. If that value evaluates to an instance of a class with a private name (i.e. it starts with an underscore), pyright will now assume that the value is potentially a singleton sentinel value similar to None and will infer the type to be a union of that type and Unknown.