Pyright

Latest version: v1.1.398

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

Scan your dependencies

Page 39 of 82

1.1.177

Bug Fix: Fixed bug in stub generation logic. It wasn't properly handling module paths with more than a single ".", such as "google.cloud.storage".

Bug Fix: Fixed false positive error in certain cases where type variable was bound to a union.

Enhancement: Implemented check for an attempt to subclass an Enum class that defines one or more enumerated values. This condition generates a runtime exception.

Enhancement: Type aliases in the printed form of a union type are retained when aliased types are combined in a union.

Bug Fix: Fixed bug in completion provider's handling of key completions for TypedDicts.

Bug Fix: Fixed false positive type evaluation error when constrained TypeVar is assigned to a union that contains a compatible constrained TypeVar.

Bug Fix: Added code to work around the circular definition found in the typeshed stub that defines the os.scandir function.

1.1.176

Enhancement: Exempted check for unsafe access to TypedDict key if it's within a context manager. It was previously exempted if included in a `try` block, but some prefer to use a context manager to catch exceptions.

Behavior Change: Bumped pyright's default Python version from 3.9 to 3.10.

Enhancement: Added support for "bare" `ClassVar` annotations.

Enhancement: Updated to the latest version of typeshed stubs.

Enhancement: Added new "--warnings" command-line option that generates an exit code of 1 if one or more warnings are emitted. By default, only errors generate an exit code of 1.

Bug Fix: Fixed bug that resulted in a "unknown member of module" error if the member referred to a submodule that was imported privately from another module but that submodule was also explicitly imported. For example, if a module imports both `a` and `a.b` and then uses the symbol `a.b.c`.

Enhancement: Added new diagnostic check "reportMissingParameterType" that checks for function and method input parameters that are missing a type annotation.

Enhancement: Added support for new type guard pattern: `x[I] is None` and `x[I] is not None` where `x` is a tuple or union of tuples with known lengths and entry types and `I` is an integer.

Enhancement: Enhanced the stub generation logic to emit `__all__ = ...` and `__all__ += ...` statements when they appear in the module scope and are not within a conditional (if/else) block.

1.1.175

This is a "hot fix" release that addresses two regressions introduced in 1.1.174.

Bug Fix: Reverted a change that broke the use of generic dataclass types.

Bug Fix: Reverted a change that resulted in a false positive error when subclassing an Enum base class that defined no enumerated values.

1.1.174

Behavior Change: Modified import resolution logic to handle namespace stub packages. This case isn't explicitly covered by PEP 561, but there is a proposal to amend the PEP to clarify how to handle this case.

Bug Fix: Fixed bug that resulted in a false negative when dealing with types that are conditioned on constrained or bound TypeVars.

Bug Fix: Fixed bug that affected a missing type argument for a ParamSpec type parameter. It should be an Unknown type.

Bug Fix: Fixed bug that resulted in an `Unknown` type appearing in a type evaluation for an unannotated variable that is modified in a loop.

Enhancement: Added error reporting for an attempt to subclass an Enum class and a duplicate definition of enum members.

Enhancement: Improved error reporting for index expressions used for non-generic classes.

Enhancement: Fixed performance issue in stub generation code that caused stub generation to take longer than needed.

Enhancement: Added performance improvement that skips return type inference for functions whose parameters are not annotated and have a "code flow complexity" beyond a certain threshold.

Bug Fix: Fixed bug the resulted in a false positive when an overloaded function is passed as an argument to a function that accepts a callable parameter using generics.

Bug Fix: Fixed a false positive error when a class with an overloaded constructor is passed as an argument to a callable parameter.

Bug Fix: Fixed bug in type var matching logic that resulted in a false positive when using a generic class that conforms to a generic protocol and uses that protocol within its own method signatures.

1.1.173

Bug Fix: Fixed a false positive error with the new union syntax when the LHS expression is an Any or Unknown type.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug in ParamSpec specialization code that can occur when using a generic type alias with a ParamSpec.

Bug Fix: Fixed false positive error when assigning a callable to a callback protocol that includes a ParamSpec.

Bug Fix: Fixed bug that resulted in unbound variable condition not being reported if it was in a loop and was assigned conditionally.

Bug Fix: Fixed bug relating to the use of an `Any` type argument corresponding to a ParamSpec type parameter.

Bug Fix: Fixed a false positive error when using a generic descriptor class that is parameterized by the `self` or `cls` parameter of the class that allocates the descriptor.

Enhancement: Added check for inappropriate use of a field annotated with `InitVar`.

Bug Fix: Fixed bug that resulted in a false positive error when a protocol class used generic type parameters scoped to a method.

1.1.172

Enhancement: Added completion suggestion support for TypedDict keys and values. Thanks to Robert Cragie for this contribution!

Behavior Change: Changed behavior of reportInvalidTypeVarUse diagnostic check to flag bound type variables used as type arguments within return type annotations.

Enhancement: Implemented code that applies type narrowing to local variables and parameters when they are captured by an inner-scoped lambda or function and the variable or parameter is not reassigned after the lambda or function along any code flow paths.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed a bug in ParamSpec handling that resulted in false positives when a callable type containing a ParamSpec was assigned to another callable type containing a ParamSpec.

Enhancement (from pylance): Improved handling of type checking when files are opened in "single file" mode, rather than opening a project root directory.

Enhancement (from pylance): Implemented heuristic for detecting import roots within a project. Previously, these all needed to be specified through "extraPaths" settings, but now pyright is smarter about locating these directories automatically.

Bug Fix: Fixed false positive error when a generic class with a ParamSpec type parameter implements a descriptor protocol.

Page 39 of 82

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.