Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 2 of 81

1.1.385

Bug Fixes:
* Fixed bug that leads to a false positive error when using `Literal[]` in a value expression (not a type expression) with an unpack operator.
* Fixed a recent regression that results in a false positive in cases where a dataclass field has a default value where the expression requires bidirectional type inference for proper type evaluation.
* Fixed recent regression that results in a false negative when calling a constructor for a class with a custom metaclass with a `__call__` method that has an unannotated return type if the arguments passed to the constructor are incorrect.
* Fixed bug that results in a false positive when a NamedTuple field uses `...` as a default value in a stub file.
* Fixed recent regression that leads to a false positive error when assigning a generic method within a class body.
* Fixed recent regression that results in a false negative when calling a function with an `*args` parameter annotated with an unpacked `tuple`.
* Fixed bug that results in false positive error when a dataclass field is annotated with a class-scoped type variable and includes a default value whose type require bidirectional type inference.
* Fixed bug that results in incorrect type evaluation and a false negative when accessing an attribute through a TypeVar with an upper bound.
* Fixed bug that results in false positive error regarding a `__bool__` method for a value used in an operand for an `or` or `and` operator.

Enhancements:
* Added check for `alias` keyword argument in a `dataclass_transform` field definition call to ensure that it's a valid Python identifier.

1.1.384

Bug Fixes:
* Fixed bug that results in a false positive when `Union` and `Unpack` are used outside of a type expression. Normal type expression rules should not be applied in this case.
* Fixed bug that results in a false negative under certain circumstances when using PEP 695 syntax and a TypeVarTuple multiple times in a signature.
* Added limiter to sequence pattern matching logic to prevent a combinatoric explosion when performing tuple expansion during narrowing.
* Fixed bug that results in incorrect type narrowing on assignment if the narrowed type is `Self` or another bound type variable.
* Fixed a bug that leads to a false negative when a class-scoped variable is annotated with a value-constrained type variable and assigned a default value with one of the value constraints.
* Fixed bug that results in a false positive when using a traditional (non-PEP 695) TypeVar in a type expression and assigning to a `TypeForm`.
* Fixed recent regression that caused false positive errors with protocol matching in certain circumstances.
* Fixed bug that leads to a false positive when a callable object uses a `Callable` type annotation for the `self` parameter in its own `__call__` method.
* Fixed a bug that results in the inability to rename a NamedTuple field.
* Fixed a bug that results in incorrect type evaluation when the type of a dataclass field is declared with a type variable but its default value is concrete.

Enhancements:
* Enhanced `isinstance` narrowing logic to retain type arguments in cases where the filter type (the second argument) is a child of the un-narrowed type and the child has a type parameter that is used multiple times in its base class (e.g. `Child[T](Parent[T, T])`).
* Improved determinism of type evaluations involving unions of literal by taking into consideration literal values when sorting subtypes.
* Updated typeshed stubs to the latest version.
* Added support for `*args: Unpack[T]` when `T` is a type variable with an upper bound of a tuple.

Behavior Changes:
* Removed provisional support for [PEP 746](https://discuss.python.org/t/pep-746-typedmetadata-for-type-checking-of-pep-593-annotated/53834) because the PEP has been modified, and there is disagreement about the best approach.
* Changed the default python version from 3.12 to 3.13, now that 3.13 is the latest stable release.

1.1.383

Bug Fixes:
* Fixed a bug that resulted in an incorrect error when using a ` pyright: standard` directive.
* Fixed a bug that leads to incorrect type evaluation when "literal math" for unary operators are applied to a TypeVar value that has a literal value upper bound.
* Fixed bug with the provisional `TypeForm` support that breaks aliases of `Annotated`.
* Fixed bug that results in incorrect variance inference for some generic type aliases that use auto variance and nested callable types.
* Fixed bug that resulted in a false negative when assigning a specialized recursive generic type alias to itself when variance of its type parameters are not covariant.
* Fixed several bugs related to the explicit specialization of a generic type alias parameterized by a single ParamSpec. `Concatenate` was being handled incorrectly.
* Fixed bug that results in a false negative when a type variable is defined with the expression `...`. This should be flagged as an illegal type expression.
* Fixed bug that caused type alias to `Never` or `NoReturn` to lose its type alias association in some circumstances.

Enhancements:
* Improved verbose logging of execution environment information.
* Added code to propagate information about certain typing module imports from an implicitly-imported module (e.g. `builtins` or `__builtins__.pyi`) so `Final` and `ClassVar` can be treated as special forms by the binder. This fixes the use of these typing symbols in notebooks within pylance, which leverages implicitly-imported modules to "chain together" notebook cells.
* Added check for use of a TypedDict class within a `case` statement class pattern. This condition generates a runtime error.
* Improved type evaluation performance in certain cases involving protocol matching for complex, nested protocols.

1.1.382.post1

1.1.382.post0

This release fixes a regression with `nodeenv` support in the `v1.1.382` release

1.1.382

Bug Fixes:
* Fixed bug that can result in incorrect type evaluation behaviors if a call to `type` is used within a loop.
* Fixed bug that results in incorrect type inference for list, set, dict, and tuple expressions that include modules in them.
* Fixed bug that results in false positive error when using a `Final` variable in a protocol and a NamedTuple or frozen dataclass as a concrete class.
* Fixed bug that results in a false negative when assigning a value to a union type that includes the same type variable multiple times in at least one invariant context. This change eliminates the concept of a "locked" constraint tracker, which is no longer needed and was the underlying cause of the bug.
* Fixed bug that resulted in a "reportIncompatibleMethodOverride" error being reported in the wrong location when a property method has a decorator applied to it.
* Fixed a bug that results in a false positive when assigning `Never` to a type variable in a contravariant context.
* Added check for the illegal use of `TypeForm` as the second argument to an `isinstance` or `issubclass` call.
* Fixed bug that results in incorrect type narrowing when a value typed as `TypeForm` is used as the first argument to `isinstance`.
* Fixed a bug that can result in a false positive error when a function signature contains a positional-only parameter and a keyword parameter with the same name. This can result from the application of a ParamSpec or through the use of an unpacked TypedDict.
* Fixed a bug that results in incorrect type evaluation behaviors when a class has a custom metaclass with a `__call__` method and a `__new__` or `__init__` method that provides a different bidirectional type inference context for parameters.

Enhancements:
* Added special-case handling for the `len(t) == L` type guard pattern to handle the negative narrowing case where tuple `t` has a minimum length of `L`. In this case, the narrowed type can be computed whereas previously it was left unnarrowed.
* Improved hover text for converters in dataclass-like classes.
* Updated typeshed stubs to the latest version.
* Extended `reportUnnecessaryComparison` to cover more cases involving `is` and `is not` operators.

Page 2 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.