Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 40 of 81

1.1.162

Enhancement: Added support for unpacking of objects that derive from known-length tuples. This includes named tuples.

Enhancement: Improved match statement code flow logic to handle the case where a pattern is exhausted prior to the last case statement.

Enhancement: Improved "implied else" code flow logic to handle nested "implied else" constructs.

Bug Fix: Fixed regression that affected type narrowing of subscript expressions for TypedDict objects.

Bug Fix: Fixed false positive error caused by inappropriate method binding for instance methods.

Enhancement (from pylance): Added more support in completion provide for literal expressions.

Bug Fix: Changed registration of language server to allow for URI types other than files. This allows pyright to be activated when an untitled file is identified as a python source file.

Bug Fix: Fixed false positive error when assigning to a subscript expression where the base type is a TypedDict.

Bug Fix: Fixed false positive error when "*P.args" parameter (where P is a ParamSpec) is passed as an argument to another function that accepts "P.args".

Bug Fix: Added support for member access expressions where the attribute contains a class whose metaclass implements a descriptor protocol.

Bug Fix: Fixed crash due to infinite recursion when a protocol class included a property getter that returned an instance of the same protocol class.

Enhancement: Improved the readability of error messages related to protocol type mismatches.

Bug Fix (from pylance): Fixed diagnostics for source files that are not on disk (e.g. "untitled" new documents).

Enhancement (from pylance): Added support for attribute docstrings in hover text.

1.1.161

Bug Fix: Fixed bug in declaration provider that caused declaration not to be found when it referred to a metadata method.

Bug Fix: Fixed bug that resulted in a false when evaluating nested lambdas (i.e. a lambda that returns a lambda).

Enhancement: Added support for bidirectional type inference for assignment expressions where the LHS is an index expression that indexes into a TypedDict instance.

Enhancement: Added support for new type narrowing pattern for discriminating among tuples. The pattern is `V[I] == L` or `V[I] != L` where `I` is an integer literal, `L` is another literal value, `V` is a tuple with a known length and a type at index `I` that is declared as a literal type.

Enhancement: Improved logging for import failures. The previous code was printing the same log message for both stub and non-stub package resolution attempts which resulted in seemingly redundant messages.

Enhancement: Added heuristic to allow proper inference of list expressions when used as the RHS operand in an expression of the form `my_list + [x]`.

Bug Fix: Fixed a bug that was masking some error messages when multiple errors were reported for the same range and their message started with the same 25 characters.

Enhancement: Changed method and attribute override compatibility checks to check for inappropriate overrides of all base classes in the multi-inheritance case. Previously, this check used MRO, so some override mismatches were left unreported if they were obscured by another base class. The change also affects `final` checks.

Enhancement: Added support for descriptor protocols defined on metaclasses.

Bug Fix: Fixed a bug that caused methods in generic classes to be specialized twice when accessed through a member access expression.

Bug Fix: Fixed false positive error when accessing `__name__` instance variable in a class that derives from `type`.

Enhancement: Updated typeshed stubs to the latest version.

1.1.160

Enhancement: Updated the "type(x) is y" type narrowing logic to handle the negative case when the class type is "final".

Bug Fix: Fixed bug that prevented "rename symbol" from working when in single-file mode. Rather than failing, it will now perform a rename only within a single file.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed false positive that occurs when defining an abstract dataclass and one of its fields refers to the class itself in its type annotation.

Bug Fix: Fixed bug in `x is None` type narrowing logic when `x` was typed as `object`.

Bug Fix: Fixed bug that verified that a protocol class used within an isinstance call is runtime_checkable. It was skipping this check when the first argument to isinstance was an Any or Unknown type.

Bug Fix: Fixed bug where a union of Literal[False] and Literal[True] were being coalesced into bool inappropriately in the case where they were conditional types that came from a constrained TypeVar.

Bug Fix: Removed the assumption that all top-level modules in typeshed third-party stubs are unique. The typeshed folder structure allows multiple packages to have the same top-level module.

Bug Fix: Fixed bug in the handling of generic recursive type aliases.

Enhancement: Implemented support for new Python 3.10 dataclass features: `kw_only` parameter for `dataclass` and `field` and `KW_ONLY` separator.

1.1.159

Bug Fix: Fixed bug that could lead to an internal stack overflow when a generic value was used as an argument for a function or class decorator.

Enhancement: Added support in literal comparison type narrowing to filter out comparisons to "None" in positive case.

Bug Fix: Fixed bug in parser where it was too permissive in allowing keywords to be used as identifiers. The Python interpreter is less permissive, so pyright's parser should match.

Bug Fix: Fixed several bugs that caused crashes (dereference of undefined variable) in certain circumstances.

Enhancement: Added a new log error for the case where enumeration of files within the workspace is taking longer than 10 seconds.

Bug Fix: Fixed bug in tokenizer which treated 'constructor' as a keyword.

Bug Fix: Fixed bug in "type(x) is y" type narrowing logic to handle the case where x is an instance of a generic class.

Enhancement: Added check for illegal trailing comma in "from x import y," statement. This generates a syntax error at runtime.

Enhancement: Added check for illegal use of "Protocol" as a type argument.

Enhancement: Implemented new check for a class that is decorated with `final` but does not implement all abstract methods from abstract classes that it derives from.

Enhancement: Added check for inappropriate use of `ClassVar` that will generate runtime exceptions.

Enhancement: Added logic to enforce protocol mismatches if a member in the protocol is marked "Final" and the class is not (or vice versa).

Behavior Change: Modified assignment type narrowing for index expressions so it applies only to built-in types. This eliminates incorrect type inference when using a class that has assymetric `__setitem__` and `__getitem__` methods.

Enhancement: Fixed false positive error when `property` is combined with `functools.cache`.

1.1.158

Bug Fix: Fixed handling of generic type aliases with missing type arguments used in type annotations when the type alias itself is a member access expression.

Enhancement: Added new diagnostic check (controlled by the existing "reportUnsupportedDunderAll" config switch) that reports an issue with a name specified in `__all__` if that symbol does not exist at the module level.

Enhancement: Updated typeshed stubs to latest version.

Enhancement: Added support for nested callables that use a ParamSpec at each level.

Bug Fix: Fixed false positive error related to the use of the `Final` keyword when annotating attributes within a dataclass.

Bug Fix: Fixed bug in TypeVar matching logic that allowed Type[T] to be matched against an instance of a type.

Behavior Change: Changed type checking logic for functions to allow a function with a return result of `NoReturn` to match against any other return type.

Bug Fix: Fixed false positive error in parser dealing with f-strings with string literals within the f-string expression that, in turn, have quotes within the string literal.

Enhancement: Added support for "attribute docstrings" (defined in PEP 258) in completion provider.

Bug Fix: Fixed bug in type analyzer related to a TypeVar with a bound type that is a union.

1.1.157

Bug Fix: Fixed false positive error when calling an object that has an `Any` in its inheritance chain.

Enhancement: Improved support for `callable` type narrowing in cases where the type is a non-callable instance, but a subtype could be callable.

Enhancement: Improved handling of `callable` type narrowing when the type involves a constrained type variable.

Enhancement: Added support for ParamSpec's within a Protocol, which is supported in Python 3.10.

Enhancement: Improved handling of `isinstance` type narrowing logic when the type being narrowed is a callable.

Bug Fix: Fixed recent regression in type evaluator that occurs when a generic (non-specialized) type is assigned to another generic type and the type parameter(s) for the generic type are invariant.

Bug Fix: Fixed bug that caused diagnostics from an open file not to be cleared after closing that file if it was not saved.

Enhancement (from pylance): Improved completion suggestions for literals when used as dictionary keys.

New Feature: Implemented "reportUninitializedInstanceVariable" diagnostic check that looks for instance variables that are not initialized in the class body or constructor.

Bug Fix: Fixed false positive error due to bug in constraint solver related to the handling of `Type[T]` when `T` is a constrained type variable.

Bug Fix: Fixed false positive error related to the use of a recursive type alias when `from __future__ import annotations` was in effect.

Bug Fix: Fixed false negative related to augmented assignment expressions when operand was a union type and a subset of the union subtypes were not supported for the operation.

Page 40 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.