Pyright

Latest version: v1.1.398

Safety actively analyzes 723685 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 68 of 82

1.1.1

Enhancement: Implemented an optimization that further sped up analysis by about 10%.

New Feature: Added reportAssertAlwaysTrue configuration switch, which flags situations where an assert statement uses an expression that always evaluates to true.

Bug Fix: Fixed edge cases in abstract class detection and reporting of attempts to instantiate an ABC.

Bug Fix: Fixed a couple of behavioral regressions related to the recently-added onlyOpenFiles setting.

Bug Fix: Fixed a regression where imported symbols from unresolved imports were flagged as "unbound" rather than being treated as unknown.

1.1.0

This version of pyright features a rewrite of the type checking engine. I've decided to bump the minor version to 1.1 accordingly. I've done significant testing of the new version, but it's possible (likely) that there will be some regressions or behavioral changes. Please report any problems you encounter, and I'll try to fix them quickly.

The old type checking engine was a multi-pass analyzer. In each pass, it attempted to resolve the types for each symbol at each point in the program. To handle cyclical dependencies between types, it analyzed each file multiple times — often two or three — until all of the types converged to stable values.

The new type checking engine uses a technique called "lazy evaluation". Instead of analyzing each file top to bottom, it visits nodes of the program in whatever order is necessary to resolve each type. It does this across files as necessary. This technique is significantly faster. For most code, you will see an immediate 2x speedup. For pyright's own unit tests, I saw a speedup of about 8x.

Another big change in this version is that VS Code version of pyright defaults to analyzing and reporting errors only for files that are opened in the editor. This matches the behavior of TypeScript and other language services in the VS Code world. If you liked the old behavior of pyright where it reported errors for all source files in your program regardless of whether they were open, you can change this in the VS Code settings (turn off the "pyright.openFilesOnly" setting).

Other changes in this release:

Bug Fix: Fixed bug in TypeVar matching for generics when multiple constrained types were present.

Bug Fix: Fixed bug that caused incorrect errors when import statements were used within an if statement that checks TYPE_CHECKING.

Bug Fix: Fixed a few bugs in type stub generation.

1.0.84

This version contains a major change in the way pyright infers the type of local and member variables that have no explicit type annotation.

Bug Fix: Fixed issue in definition provider that caused it to return duplicate definitions for some symbols.

Bug Fix: Fixed a bug in constructor specialization code. The `__init__` specialization was being overwritten by the `__new__` specialization, often discarding important type arguments in the process.

Bug Fix: Fixed regression in hover provider where it didn't return any hover information for unresolved import symbols.

Bug Fix: Fixed bug where argument value expressions were not evaluated if they didn't match any parameters.

Bug Fix: Fixed bug relating to scoping of variables introduced within list comprehensions.

Bug Fix: Fixed bug in TypeVar matching logic.

1.0.83

Enhancement: A rewritten implementation of the code flow and type constraint engine provides better handling of complex code flow like nested loops, try/except/finally statements, etc.

Enhancement: In VS Code extension, changed the logic for how to handle opened files that don't fall within any workspace. Previously, all such files were analyzed in a default workspace using default settings. The new logic uses the current workspace if there is only one. The "default" workspace fallback is still used for multi-root workspaces.

Bug Fix: Fixed bugs in logic that determines when to allow importing a non-stub from a stub file. It's not allowed for third-party files.

Bug Fix: Changed import logic to search for imported symbols in the target module before looking for submodules of the same name.

Bug Fix: Unreachable code is displayed even for files where errors or warnings are suppressed.

Bug Fix: Fixed TypeVar matching logic to avoid adding widened types if the TypeVar was already matched against subclasses of the type that is being added.

Bug Fix: Union types that include Literal[True] and Literal[False] are now collapsed into a 'bool' type.

1.0.82

Bug Fix: Fixed type completions for TypedDict classes when TypedDict is imported from typings (versus typing_extensions).

Bug Fix: Fixed bug that affected proper type evaluation for CTypes like c_uint64.

Bug Fix: Changed server to create <default> service on demand, when a file is opened that doesn't match any existing workspace.

Bug Fix: Fixed bug that caused list[x] and List[x] not to be combined into the same union type.

Bug Fix: Added support for proper type inference for assignments that target lists (e.g. `[a, b] = [1, 2]`).

Enhancement: Added missing methods and attribute to memoryview class in builtins.pyi.

1.0.81

Enhancement: Command-line version now exits with a new exit code (3) if the pyrightconfig.json is malformed or cannot be read. Previously, it proceeded to perform the analysis with default settings.

Enhancement: Added support for interleaved for and if clauses within a list comprehension statement. Previously, the analyzer assumed that there would be only one if clause and it would be after all for clauses.

Enhancement: the built-in function issubclass is now supported by the analyzer in the same way as isinstance. It can be used as a type constraint in conditional code flow statements (if, while, etc.), and the reportUnnecessaryIsInstance setting applies to it.

Enhancement: Added support for the abc.abstractproperty function decorator.

Bug Fix: Fixed a reported bug relating to the handling of the overload function decorator. This was due to a recent regression.

Page 68 of 82

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.