github microsoft/pyright 1.1.309
Published 1.1.309

latest releases: 1.1.383, 1.1.382, 1.1.381...
16 months ago

Behavior Change: Reworked the logic for constructor type analysis to better mirror runtime behaviors of the type.__call__ method. This is a big change with a potential for regressions.

Bug Fix: Fixed bug that led to a false positive under certain circumstances when assigning a value to a variable with a type annotation that evaluates to a descriptor type.

Bug Fix: Fixed a regression that resulted in incorrect type evaluation when passing an argument to a generic class constructor when the argument expression includes an "or" or "and" operator.

Enhancement: Extended the reportUninitializedInstanceVariable check to detect the case where a @final class derives from an abstract base class (or hierarchy thereof) and does not implement one or more variables defined (but not assigned) in an ABC.

Enhancement: Implemented a check for an attempt to invoke a static or class method that is marked abstract.

Behavior Change: Deprecated command-line options 'typeshed-path' and 'venv-path' in favor of 'typeshedpath' and 'venvpath'. The hyphenated options were inconsistent with the conventions used for other options.

Enhancement: Added command-line option pythonpath that allows the path to the python interpreter to be specified.

Behavior Change: Updated support for type statement to conform with the latest updates to PEP 695. It now supports forward declarations, not just self references.

Enhancement: Added support for explicit calls to TypeAliasType constructor, as defined in PEP 695.

Behavior Change: Since PEP 696 won't make it for Python 3.12, pyright now enforces the Python 3.13 requirement for this capability (unless it's in a stub file or TypeVar, TypeVarTuple, and ParamSpec are imported from typing_extensions).

Performance: Changed import resolver to use sets and maps rather than arrays for tracking implicit imports. Arrays are fine if there are a few dozen implicit imports, but if there are thousands, they become a performance issue.

Performance: Added caching in import resolver for relative imports. Previously, we cached only absolute imports.

Performance: Added optimization to alias resolution that avoids the need to parse and bind a file in some cases.

Bug Fix: Fixed a bug that led to a false positive error in an edge case condition that involves an unpacked TypeVarTuple.

Enhancement: Added a check for f-strings that use nested braces in the "format specifier" portion (the section after a colon). This condition generates a syntax error at runtime, so it's useful for pyright to detect and report the error.

Bug Fix: Fixed a bug that results in a false positive error when using a dynamic base class in a class statement where the dynamic base class is based on a bound type variable.

Behavior Change: Changed pyright to reflect a recent decision about PEP 649 (deferred type annotations). The steering council tentatively approved PEP 649 for Python 3.12, but they recently decided to defer it until 3.13.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.