Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 22 of 81

1.1.268

Behavior Change: Exempted `__new__` from parameter covariance check. This is consistent with `__init__`, which is already exempted from this check.

Bug Fix: Fixed a bug that resulted in a false negative when using an unparenthesized assignment expression in an assert statement. Also improved the error messages and parser recovery for incorrect use of a unparenthesized assignment expressions.

Bug Fix: Fixed a bug that resulted in a false positive when analyzing a call to an instance method that omits a `self` parameter and instead uses `*args`.

Enhancement: Improved error reporting for dict literal expressions that are assigned to TypedDict types. Previously, the entire dict literal was included in the error range. Now the range is limited to a specific dictionary entry if there is only one error.

Enhancement: Extended type narrowing support for `x in y` pattern where `y` is a tuple of known length that includes literal types. In this case, negative ("else") type narrowing can be applied if `x` is a union that includes literals.

Behavior Change: Increased the code complexity limit that controls whether pyright performs return type inference for functions that have no parameter type annotations. This can be quite expensive, and without parameter types, the results are often low quality. Beyond a certain point, we just skip the expensive analysis and infer a return type of `Unknown`. The previous limit was quite low. This increases the limit in an attempt to handle return type inference in more of these cases.

Enhancement: Added a missing check for a `**kwargs` parameter immediately after a keyword-only separator `*` parameter. This generates a compiler error in Python.

Enhancement: Updated typeshed stubs to the latest version.

1.1.267

Bug Fix: Fixed bug that caused error to be suppressed when calling `assert_never` with bad arguments (incorrect number, etc).

Enhancement: Added support for dictionary expansion of a TypedDict within a dictionary literal expression.

Enhancement: Extended support for union expansion of constrained type variables when performing overload matching.

Bug Fix: Fixed a bug that resulted in different type evaluation behaviors depending on the order of callable types within a union.

Bug Fix: Fixed bug that resulted in a false positive error when the second argument to a `type` constructor call includes a tuple that includes a `type` class.

Bug Fix: Fixed a bug that resulted in incorrect type evaluation when a generic type alias consists solely of a type variable or a type variable wrapped in `Annotated`.

Bug Fix: Fixed bug in parser that resulted in crash when a soft keyword was used as a class pattern keyword argument name.

Bug Fix: Fixed a bug in the special-case logic that handles `__all__.extend(<submodule>.__all__)` so it better handles the case where `<module>` is imported using an import statement of the form `from x import submodule`.

1.1.266

Bug Fix: Fixed a bug that caused a false positive error when using a list comprehension within a method that is overloaded to accept either a `LiteralString` or a `str`. The incorrect overload was chosen in some cases, picking the `LiteralString` variant rather than the `str` variant even though `LiteralString` variant generated type errors.

Bug Fix: Fixed a bug that caused incorrect type evaluation because of stale module paths that are cached for specific source files. Module paths are dependent on the list of configured import resolution paths, so when the import resolution paths change, we may need to recompute the module path for a source file.

Bug Fix: Fixed a bug that resulted in a false negative when a `del` statement targeted a symbol that was unbound (i.e. referenced before assigned) within a function.

Behavior Change: Changed behavior of `assert_type` to treat `Any` the same as `Unknown` for purposes of type comparison. There is no way to express an `Any` type explicitly in the Python type system because it is, by definition, an "implicit" Any.

Bug Fix: Fixed a bug that resulted in a false negative when evaluating binary operations that involve unions for either the LHS or RHS or both.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when bidirectional type inference was used along with a type alias that was involved in a circular declaration.

Bug Fix: Fixed a bug that resulted in a false positive error when `LiteralString` was used as the base type in an index expression.

Behavior Change: Changed the `--verifytypes` command to skip docstring checks for overloads and for property setters and deleters.

Bug Fix: Fixed a bug that resulted in a false positive when evaluating type compatibility of a type that includes an invariant type argument consisting of a union that contains a generic callable.

Enhancement: Enhanced support for handling of functions that return `NoReturn` to include support for overloaded functions where some of the overloads return `NoReturn` and others do not.

Enhancement: Updated typeshed stubs to the latest version.

Enhancement: Added better verbose logging for the case where an import cannot resolve the source file leading to a `reportMissingModuleSource` diagnostic.

1.1.265

Bug Fix: Fixed two type evaluation bugs that caused false positive errors when using `join` method with `LiteralString` and when a format string is interpreted as a `LiteralString`.

Bug Fix: Fixed false positive errors that resulted from the previous change to format string type inference.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed a bug that led to sporadic false positive errors for expressions that involve a call to `super()`.

Bug Fix: Fixed a bug that resulted in a false positive error when assigning a property created through the `property` decorator to a variable or parameter annotated with the type `property`.

Bug Fix: Fixed a bug that resulted in incorrect bidirectional type inference for constructor calls for generic classes when the expected type was `Self`.

Bug Fix: Fixed a bug that resulted in a false positive error when using an unpack operator (`*`) in a quoted type annotation with versions of Python prior to 3.11.

Performance: Improved performance of code flow engine in cases where two variables have significant strong interdependencies and are modified within a loop.

1.1.264

Bug Fix: Fixed bug in `reportUnnecessaryContains` check that resulted in a false positive when the container element type is a TypeVar. The same logic error was present (and fixed) in the type narrowing logic for `in` expressions.

Bug Fix: Fixed bug in `reportUnnecessaryComparison` check that results in a false positive error when comparison chaining is used.

Bug Fix: Fixed bug that resulted in a false positive error when using a TypedDict that has been narrowed via an assignment to a not-required key.

Bug Fix: Fixed a bug that resulted in incorrect type inference for unannotated parameters with a default argument value in an `__init__` method.

Enhancement: Added support for `_generate_next_value_` override for `Enum` class.

Bug Fix: Fixed a bug in the type printer code that resulted in an infinite recursion and crash.

Behavior Change: Changed `reportUninitializedInstanceVariable` check to exempt protocol classes.

Bug Fix: Fixed a bug that resulted in infinite recursion and a crash when inferring return types for functions that returned another function that also has an inferred return type, etc. in a cycle.

1.1.263

Bug Fix: Fixed bug that resulted in inconsistent behavior for types inferred from tuple expressions containing literal entries.

Bug Fix: Fixed recent regression that resulted in incorrect type evaluation when a forward-referenced recursive type alias was used as an iterable type.

Bug Fix: Fixed bug that resulted in incorrect type evaluation within case statement in some situations.

Bug Fix: Fixed bug that resulted in sporadic errors when evaluating index expressions within a loop.

Performance: Simplified some internal types, which results in less memory usage and better performance.

Performance: ixed a performance issue (combinatoric explosion) related to TypedDict classes that were narrowed based on a series of `in` type guard tests.

Page 22 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.