Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 43 of 81

1.1.144

Bug Fix: Changed CLI to not use process.exit() but instead return normally. The previous code sometimes resulted in truncated output.

Enhancement: Added error for keyword-only parameter separator or position-only parameter separator appearing in a function signature after an "*args" parameter. This will result in a runtime error.

Enhancement: Improved error message for missing **kwargs parameter when assigning one function to another.

Bug Fix: Fixed bug in logic that converts a type into a text representation. It wasn't properly adding the scope for a ParamSpec in certain circumstances, so instead of outputting `Pscope`, it was outputting `P`.

Bug Fix: Fixed bug in specialization of generic class that contains only one type variable that is a ParamSpec.

Bug Fix: Fixed bugs that prevented ParamSpec annotations `P.args` and `P.kwargs` from working properly when the annotation was in quotes.

Bug Fix: Fixed false positive error in check for inappropriate use of contravariant type var in return type annotation. It should not generate an error when the contravariant type var is part of a union.

Enhancement: Improved error message consistency for "cannot assign to None" condition.

1.1.143

Bug Fix: Added missing recursion check that resulted in stack overflow in type evaluator.

Enhancement: Added support for unpacked dictionary argument in function calls when the unpacked expression is a TypedDict.

Enhancement: Improved error message for the case where positional-only parameters are used in a function and a caller does not provide enough arguments.

Bug Fix: Improved logic for argument matching for call expressions where the call includes keyword-only parameters and the call expression includes an unpacked list argument.

Bug Fix: Fixed bug in type evaluation of list comprehensions when literal types were involved. The literal types were being widened to their associated non-literal types.

Enhancement: Improved `isinstance` type narrowing logic to accommodate the case where the first argument to `isinstance` is a module and the second argument is a runtime-checkable protocol class.

Bug Fix: Fixed regression that caused false positive in the case where a `Callable` type was used that defined its own TypeVar scope and was later matched against a `self` parameter in an instance method.

Enhancement: Enhanced "reportIncompatibleVariableOverride" diagnostic check so it applies to instance variables defined within a method (e.g. `self.var: str = ""`) in addition to class variables.

Enhancement: Added type narrowing support for index expressions where the index value is a string literal.

Enhancement: Added support for "tagged union" type narrowing when the conditional expression is of the form `x[K] == V` or `x[K] != V` where `x` is a union of TypedDict objects and `K` is a literal str key value that refers to a field with a literal type and `V` is a literal value.

1.1.142

Bug Fix: Fixed false negative (missing error) due to bug in dictionary expression bidirectional type inference logic when the expected type included a union.

Enhancement: Added support for subscript expressions that contain slices when applied to tuples with known lengths.

Bug Fix: Fixed false negative condition where a protocol class was treated as a callback protocol even though it included members other than `__call__`.

Bug Fix: Fixed false positive error when a builtin symbol was used in a file but later redeclared within the module scope.

Bug Fix: Fixed bug in "expression printer" which is used in some error messages. It was not properly preserving parentheses for binary operation expressions.

Bug FIx: Fixed false positive error for "missing type arguments" that was surfaced when changes were made within typeshed's types.pyi stub.

1.1.141

Enhancement: Improved "is None" and "is not None" type narrowing logic for constrained TypeVars that include `None` as one of the constraints.

Enhancement: Improved error message for illegal character in token and surrogate character codes combinations that are not allowed in identifiers.

Enhancement: Added support for more surrogate character ranges that I didn't realize existed when I added the initial support.

Behavior change: Don't prefer py.typed libraries when the execution environment is typeshed.

Bug Fix: Fixed bug in signature help provider where it was not properly handling a call with a type `Type[T]`.

Bug Fix: Fixed bug in code that handles "super" call when a `cls` variable is passed as the first argument.

Bug Fix: Changed the way the current parameter index is specified in signature help to better conform to LSP standard.

Enhancement: Improved the "X is incompatible with Y" error message in the case where types X and Y have the same short name. In this case, the fully-qualified names will be used to provide clarity.

Bug Fix: Fixed bug that resulted in false positive when generic type was used for iterable within a list comprehension.

Bug Fix: Fixed bug that resulted in incorrect errors when using a TypeVar imported from another file and referenced using a member access expression (e.g. `typing.AnyStr`).

Enhancement: Added support for `defaults` argument in `namedtuple` constructor, which marks the rightmost input parameters to the resulting named tuple as having default values.

Behavior change (from pylance): Filter auto-imports more strictly to reduce the number of completions returned. Matches require at least the first character to match before fuzzy matching is applied.

Enhancement (from pylance): Add support for tables in docstrings.

1.1.140

Bug Fix: Fixed bug that caused parameters in overloaded functions not to be marked as accessed, as was intended.

Bug Fix: Fixed false negative when the same name was defined in both an outer and inner function and referenced in the inner function prior to being assigned.

Enhancement: Added support for identifiers that contain Unicode characters that require two UTF16 character codes (surrogates). This allows identifiers to use characters in the Unicode blocks for Egyptian Hieroglyphs, Linear B Ideograms, Cuneiform, Phoenician, etc.

Enhancement: Added new diagnostic rule "reportIncompleteStub", which reports a diagnostic for a module-level `__getattr__` function in a type stub, indicating that it's incomplete. This check was previously part of the "reportUnknownMemberType" diagnostic rule.

Behavior Change: Disabled support for keyword arguments in subscript expressions because PEP 637 was rejected.

Bug Fix: Fixed bug in the type specialization for ParamSpec when the return type contains no generics.

Bug Fix: Changed TypeGuard behavior to evaluate the return type of a call expression that invokes a type guard function to be 'bool' rather than 'TypeGuard[T]'.

Behavior Change: Changed TypeGuard behavior to allow a type guard function to be passed as a callback that expects the return type to be bool.

Bug Fix: Removed explicit check for Python 3.10 when using ParamSpec. It's possible to use it with older versions of Python if importing from `typing_extensions`.

Bug Fix: Fixed bug that caused a false positive error when applying a subscript operation on a TypeVar.

Bug Fix: Fixed bug that resulted in a false positive error when the second argument to `isinstance` or `issubclass` was a union that included both a single type and a tuple of types.

Enhancement: Updated typeshed stubs to the latest version.

Enhancement: Added support in typeshed VERSIONS file for submodules.

1.1.139

Enhancement: Updated typeshed to the latest.

Enhancement: Added support for typeshed VERSION file, which indicates which stdlib modules are available in each version of Python.

Bug Fix: Fixed bug that resulted in symbols being inappropriately marked "unaccessed" when they were accessed within a keyword argument used within a class declaration.

Bug Fix: Fixed false positive error when a dataclass declares an instance variable but a subclass redeclares a class variable of the same name.

Bug Fix: Fixed type narrowing bug with 'isinstance' checks that involve protocol classes. The bug resulted in false positive errors with the reportUnnecessaryIsInstance check.

Enhancement: Added support for callback protocols that use overloaded `__call__` methods.

Enhancement (from pylance): Improved performance of tokenizer's handling of string literals.

Bug Fix (from pylance): Ignore updates to ".git" file so they don't trigger reanalysis.

Bug Fix: Fixed false positive error in check for overload implementation consistency when one of the overloaded methods in a generic class provides an explicit type annotation for "self" or "cls" but the implementation does not.

Enhancement: Improved "is None" and "is not None" type narrowing logic to handle constrained TypeVar that includes None as one of the constraints.

Bug Fix: Fixed false positive error when a `__getattr__` method is present. The previous logic was assuming that `__getattr__` could provide a magic method value (e.g. for `__add__`).

Bug Fix: Prefer py.typed libraries over typeshed for consistency with PEP 561.

Bug Fix: Improved validation for function calls where the function signature includes keyword arguments without default values that are not directly matched by keyword arguments but are matched by a **kwargs argument. In this situation, the type of the **kwargs values should be verified to be compatible with the type of the keyword parameters.

Bug Fix: Fixed bug in lambda type evaluation for lambdas that use an *args parameter. The parameter type was not being transformed into a tuple, as it should have been.

Enhancement: Improved diagnostic message for constant redefinition to make it clear that the symbol is assumed to be constant because its name is uppercase.

Page 43 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.