Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 23 of 81

1.1.262

Performance: Added a faster code path for testing the type compatibility of a non-union type to a union type when the union type contains no unsolved TypeVars.

Performance: Added optimization in overload path that eliminates one extra validation of arguments in the common case.

Enhancement: Updated typeshed stubs to latest version.

Performance: Implemented tighter scoping for contextual evaluation. This improves performance of type evaluation in various use cases including semantic tokens.

Bug Fix: Fixed bug in type narrowing logic for "in" operator. It was not properly handling the case where the reference (LHS) type was a subtype of the container's element type.

Enhancement: Added support for new `reportUnnecessaryContains` diagnostic rule to catch potential bugs in `in` and `not in` containment checks.

Bug Fix: Changed the validation logic for type argument lists when found outside of a type annotation. The normal type annotation restrictions (such as no dynamic variable usage) should not apply in this case.

Bug Fix: Fixed a bug that caused `defineConstants` configuration setting not to work with the pyright and pylance VS Code extensions.

Bug Fix: Fixed a bug in the dataclass logic that resulted in incorrect handling of a dataclass field that is annotated both in the class body and (redundantly) in a method within the same class.

1.1.261

Behavior Change: Reduced the max code complexity constant to lower the cyclomatic complexity threshold for code analysis to prevent crashes with certain highly-complex code.

Bug Fix: Fixed regression that caused an internal assertion (and therefore a crash) when using an expression that includes two index expressions, one with a string literal and one without, like `a[n].b.c['x']`.

Enhancement: Added support for overloaded `__getitem__` in iterables for `for` statements.

Enhancement: Enhanced the reportIncompatibleVariableOverride check to catch cases where a Final variable overrides a non-Final variable.

Bug Fix: Fixed bug that resulted in sporadic errors during type evaluation based on evaluation order.

Bug Fix: Fixed bug in constraint solver that led to a false positive error in some situations where the solution to a TypeVar involved the union of two other TypeVars.

Bug Fix: Fixed a bug that resulted in an incorrect type evaluation when a generic callable class variable was specialized recursively with type variables for the same class.

Bug Fix: Improved handling of type consistency checks for unions so the results are less dependent on the order of subtypes within the union.

Enhancement: Enhanced `reportUnnecessaryTypeIgnoreComment` to ignore lines that are unreachable.

1.1.260

Bug Fix: Fixed regression that caused an internal assertion to fire, leading to a crash when certain forms of nested index expressions are used.

1.1.259

Enhancement: Enhanced the `reportIncompatibleMethodOverride` check to handle the case where a method is overridden by an overload and one of the overloads matches the base method.

Performance: Improved analysis performance in cases where variables within a loop have mutual dependencies.

Performance: Added performance optimization for a special case that can occur in code without type annotations. It affects "pseudo-generic" classes that are parameterized recursively.

Performance: Improved analysis performance in some cases by caching return types inferred through call-site inference.

Enhancement: Updated typeshed stubs to the latest version, which eliminates support for Python 3.6.

Enhancement: Added support for type narrowing of TypedDict instances based on assignments to a not-required key.

1.1.258

Bug Fix: Fixed a bug that resulted in incorrect type narrowing when using an `in` expression and the LHS operand is of type `type`. This situation requires some special casing.

Bug Fix: Fixed a bug in the handling of generic type aliases that are parameterized by ParamSpecs in the case where an explicit type argument is not provided. The type argument should default to `...` in this case.

Bug Fix: Fixed bug in the expression printer. It was not properly handling a minimal slice (`:`). This affected certain logging output.

Performance: Added optimization for slice expression evaluation. It can be skipped in cases where the we are speculatively evaluating the type.

Performance: Implemented optimization for type evaluation for index expressions. In cases where there are multiple subexpressions separated by commas, we can skip the check for the `__index__` magic method.

Bug Fix: Fixed a bug that resulted in incorrect `isinstance` type narrowing when one or more of the filter classes was decorated with a class decorator.

Enhancement: Added support for context managers whose `__exit__` method is declared to return "Literal[False]". This is now treated the same as if it is declared to return "None".

Performance: Improved performance of type evaluations in certain cases where a union contains multiple types whose class hierarchy contains one or more unknown types.

Bug Fix: Fixed recent regression that resulted in attribution of a type var to the wrong scope when it was used in an `__init__` method of a class with a class decorator.

Bug Fix: Fixed bug that results in incorrect type evaluation when a function with a `**kwargs` parameter is captured by a ParamSpec in certain circumstances.

Bug Fix: Fixed bug that resulted in incorrect type evaluation for values within a TypedDict that derives from a TypedDict that has been specialized.

Bug Fix: Fixed a bug that results in a spurious "argument type is unknown" diagnostic when an unannotated variable used within a loop is also used as the subscript for an index expression.

Bug Fix: Improved handling of incomplete types passed as arguments to magic methods.

Bug Fix: Fixed a bug that resulted in infinite recursion when using auto variance inference with certain recursive types.

Enhancement: Added more complete type validation for `__getattr__`, __setattr__` and `__delattr__` methods.

Bug Fix: Fixed a bug that resulted in a false positive when resolving a symbol from a multi-part import when a short form of that same multi-part import was also imported.

1.1.257

Behavior Change: Reverted recent change that resulted in false positive errors when using `_` as a placeholder name for methods that are used with `register` and similar decorators.

Bug Fix: Fixed regression in `isinstance` type narrowing when the filter type is a `type[x]` rather than `x`.

Performance: Implemented performance optimization related to overload evaluation.

Behavior Change: Changed `type_assert` diagnostics to fall under `reportGeneralTypeIssues` diagnostic rule rather than be emitted unconditionally.

Bug Fix: Fixed regression in completion provider by eliminating the recently-added commit characters.

Performance: Improved performance of semantic highlights, hover, and completion suggestions for member access expressions.

Performance: Improved performance in type guard logic by not evaluating a call expression base type until after verifying that the call potentially narrows the reference expression.

Bug Fix: Fixed a bug in the handling of `for` loops that resulted in incorrect type inference for the target expression.

Bug Fix: Fixed several bugs that resulted in incorrect type evaluations when a property getter or method has an inferred return type that contains a type variable.

Bug Fix: Fixed a bug that resulted in incorrect type evaluation of `NewType` for versions of python older than 3.8. (In 3.8, NewType was changed from a function to a class.)

Enhancement: Implemented provisional support for proposed PEP 695: Improved Syntax for Type Parameters. The new functionality is available only if you manually configure pyright to assume Python 3.12. It supports the new type parameter syntax, support for "type" statements (for type alias declarations) and support for autovariance.

Enhancement: Updated typeshed stubs to the latest version.

Page 23 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.