Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 29 of 81

1.1.226

Bug Fix: Improved parser to detect extremely deep chains of call expressions that can crash the type evaluator.

Bug Fix: Fixed bug that resulted in false positive error when detecting overlapping method overloads when the overloads use a class-scoped TypeVar.

Bug Fix: Fixed a bug that resulted in a false positive error when validating type compatibility between two functions with nested Concatenate and ParamSpec usage.

Bug Fix: Fixed a bug in the code flow graph relating to "with" statements that are nested within a "try" statement when the context manager does not swallow exceptions but instead forwards them to the outer except clause.

Enhancement: Improved error message for binary and unary operations when an expected type (bidirectional inference) is present.

Bug Fix: Fixed a performance issue that caused long analysis times for some code flow graphs that involve deeply nested loops and many interdependent variables.

Bug Fix: Fixed a bug that resulted in a false positive error when assigning a value of type `type | Any` to type `type[T]`.

Bug Fix: Fixed a bug that resulted in false positive errors when assigning a value to class variable that contains a generic descriptor object.

Enhancement: Improved the error message for a call expression where a keyword argument and a positional argument target the same parameter.

Enhancement: Updated typeshed stubs to the latest version.

1.1.225

Bug Fix: Added missing checks for an attempt to modify a variable that has been marked "Final" using a means other than a simple assignment statement. This includes augmented assignments, tuple assignments, for statements, with statements, assignment expressions, etc.

Behavior Change: Modified parameter type inference logic to not infer a parameter's type based on the default argument value if the value is a tuple, list, set or dict.

Enhancement: Improved type evaluation of `type(x)` to handle the case where `x` is a union type.

Bug Fix: Fixed bug that caused false negative when a class defined a `__getattr__` method but no `__getitem__` method and a subscript expression was used with a class instance.

Bug Fix: Fixed a bug in the logic that determines whether a class that derives from a protocol implements all of the functions and variables within that protocol. It wasn't considering mix-in classes.

Bug Fix: Fixed regression in "finally" type analysis that allowed type violation errors to go unreported in finally clauses.

Behavior Change: Changed the behavior of type evaluator when it encounters an unannotated symbol within a "py.typed" source file. Previously, it did not fall back on type inference and instead evaluated the type as "Unknown". It now falls back on type inference but internally marks the type as "ambiguous". Added logic to detect "likely ambiguous inferences".

Behavior Change: Updated package type verifier to differentiate between "unknown" and "ambiguous" types.

Bug Fix: Fixed a bug in type evaluator that resulted in a crash when a function signature contains a "**" parameter with no name.

Bug Fix: Fixed a bug that resulted in a crash due to infinite recursion.

Bug Fix: Enhanced parser to detect extremely deep parse trees created from index or member access expressions. The parser now emits an error rather than allowing the type evaluator to crash (with a stack overflow) in such situations.

Enhancement: Updated typeshed stubs to the latest.

1.1.224.post1

1.1.224.post0

1.1.224

Bug Fix: Improved NoReturn return call inference when the callable type evaluates to a partial Any or Unknown.

Bug Fix: Improved heuristics related to NoReturn detection when dealing with certain libraries that attempt to import another package within a `try` statement but provide a "dummy implementation" in an `except` clause. In this situation, we should use the declaration within the `try` block and ignore the one in the `except` clause.

Bug Fix: Fixed buggy assert in type evaluator that resulted in some crashes.

Behavior Change: Changed `strictParameterNoneValue` to default to true rather than false. This reflects the updated guidance in PEP 484, which indicates that type checkers should not assume that a default argument of `None` should imply an `Optional` type.

Enhancement: If CLI version of pyright is run without providing arguments to certain commands, a failure is detected and reported. Thanks to Martin Fischer for this contribution.

Bug Fix: Fixed performance regression due to a recent change in the code flow engine when attempting to evaluate whether call is a NoReturn.

Enhancement: Added support for parameter type inference based on annotated base class method signatures and on default argument expressions.

Bug Fix: Fixed recent regression that caused unnecessary reanalysis when closing a file when using pyright as an LSP. The regression also sometimes resulted in unexpected errors from reanalyzed files including diagnostics about unaccessed variables.

1.1.223

Bug Fix: Fixed a bug in negative type narrowing logic for value patterns in `match` statement.

Behavior Change: Removed provisional support for PEP 677 (Alternate Call Syntax) because the proposal was rejected by the Python steering council.

Bug Fix: Fixed a bug that led to incorrect type evaluation in the "implied else" code flow path.

Bug Fix: Improved support for functions or methods that return a context manager that swallow exceptions, such as `pytest.raises`.

Behavior Change: Modified `reportIncompatibleVariableOverride` check to permit a ClassVar in the base class to be overridden by a compatible class declaration in a child class.

Bug Fix: Fixed a bug in the type evaluator that led to false positives when assigning a function type to another function type and the source contained parameters annotated with literal types and the dest contained corresponding parameters annotated with TypeVars.

Bug Fix: Fixed bug in the handling of wildcard imports. If the target module doesn't contain a dunder all definition, the resulting imported symbol list should exclude names that start with a single underscore.

Bug Fix: Fixed bug that resulted in a false positive error when using a TypeVarTuple in a `classmethod`.

Behavior Change: Changed heap overflow detection to use a dynamic value based on available memory rather than a hard-coded size. For the pyright VS Code extension, changed the default "max heap size" from 1.7GB to 3.0GB on 32-bit systems. On 64-bit systems, this value appears to already be a higher value (4GB), and it doesn't appear to get overridden by the lower number.

Page 29 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.