Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 52 of 81

1.1.89

New Feature: Added support for new reportUnsupportedDunderAll diagnostic rule. It checks for unsupported manipulations of `__all__`.

New Feature: Implemented new diagnostic rule reportUnusedCallResult that checks whether a call expression's results are consumed. If the results are None or Any, no diagnostic is produced.

Enhancement: Added support for isinstance and issubclass type narrowing when "cls" or "self" parameters are used in the second argument

Bug Fix: Fixed recent regression with TypeGuard type that caused spurious error when a bool value was return from a user-defined type guard function.

Bug Fix: Fixed bug in reportIncompatibleMethodOverride diagnostic check where it incorrectly reported an error if a derived class used overload functions on an overridden method.

Bug Fix: Fixed bug that caused incorrect binding when invoking a class method through an instance.

Bug Fix: Fixed handling of recursive type annotations for variables (e.g. "int: int"). In some specific situations this is allowed if the annotation refers to a symbol in an outer scope.

Bug Fix: Fixed several bugs related to constructor type inference when the expected type contained generic types with type arguments that contained type variables defined in a context outside of the constructor's call site.

1.1.88

Enhancement: This release includes a major update to TypeVar code. The type checker is now much more strict about how TypeVars are treated when analyzing the bodies of generic functions or methods within generic classes.

Bug Fix: Fixed bug in synthesis of comparison operators in dataclass. By default, these methods should not be synthesized unless `order=True` is passed to the `dataclass` decorator.

Bug Fix: Fixed bug that caused incorrect specialization of a TypeVar when used in a descriptor class with a `__set__` method.

Bug Fix: Fixed incorrectly handling of generic type alias that is defined in terms of other generic type aliases.

Bug Fix: Fixed bug that caused incorrect overload to be selected in cases where a named argument was used.

Enhancement: Improved signature help for calls to namedtuple constructor.

Bug Fix: Added support for a generic method whose "self" parameter is annotated with a bound TypeVar and is then invoked using another bound TypeVar.

Bug Fix: Improved error reporting for assignments to protocols.

Enhancement: Added support for the instantiation of a class via a constructor when the type of the class is specified as a TypeVar.

Bug Fix: Fixed inappropriate error in strict mode when a named argument for a call expression begins with an underscore.

Bug Fix: Fixed bug that results in an incorrect type when a call to a function returns a generic type and the result is assigned to a variable with a declared type that includes a union.

1.1.87

Bug Fix: Fixed bug with type annotations that use a TypeVar with the new union syntax.

Behavior Change: Removed special-case code that eliminates a NoReturn from an async function.

Behavior Change: Changed behavior of NoReturn when it appears within unions. Previously, it was always filtered out of unions. It is now filtered out only in the inferred return type of a function. This allows NoReturn to be used in unions in other legitimate cases.

Bug Fix: Fixed bug that resulted in a false negative when a callable type with a kwargs parameter was assigned to a callable type without a kwargs or with a kwargs of a different type.

Enhancement (from Pylance): Changed fuzzy text matching algorithm for completion suggestions.

Bug Fix: Fixed bug whereby an assignment was not flagged as an error if the target type contains a type var and the source is concrete. This change generally makes the core type checker more strict about the use of type variables.

Enhancement: Added support for "eq" and "order" parameters in dataclass decorator as defined in PEP 557.

New Feature: Added new diagnostic rule "reportFunctionMemberAccess" that reports an attempt to access, set or delete non-standard attributes of function objects.

1.1.86

Enhancement (from Pylance): Improvements to completion provider and signature help provider.

Bug Fix: Allow `TypeAlias` to be used prior to Python 3.10 if imported from typing_extensions.

Enhancement: Added special-case handling for magic method `__class_getitem__`, which is implicitly a classmethod.

Enhancement: Added support for classes that include the `__class_getitem__` magic method to provide custom behaviors for subscripting.

Enhancement: Support detecting multiple site-packages directories in venvs. [Contribution by Truls Asheim]

Bug Fix: Fixed bug that caused incorrect type errors when dealing with magic methods on the tuple class.

Bug Fix: Fixed a confusing diagnostic message relating to incorrect method override.

Enhancement: Enforced that TypeVars being solved for in a TypeVar map match the expected scope.

Bug Fix: Fixed bug in synthesized `setdefault` method on TypedDict for required entries, which never use the default value.

Bug Fix: Fixed bug that resulted in an inappropriate error when a kwarg parameter was typed with a class-defined TypeVar (e.g. `**kwargs: _VT`).

Bug Fix: Made the check less strict for the use of covariant type vars within a function input parameter annotation. In particular, unions that contain covariant type vars are now permitted.

Enhancement: Add __future__ module as import suggestion. [Contribution by cdce8p]

Bug Fix: Fixed bug that caused the issubtype type narrowing logic to fail when used with a bound TypeVar T in combination with Type[T].

Bug Fix: Don't add suggestions for 'with Y as [ ]'. [Contribution by cdce8p]

Enhancement: Type aliases are now expanded in completion provider text in the same way as the hover text. [Contribution by cdce8p]

Enhancement: Improve handling of type aliases for auto-import. [Contribution by cdce8p]

1.1.85

Behavior Change: Changed diagnostic about first argument to `super` call to be part of the reportGeneralTypeIssues diagnostic rule so it is suppressed when type checking mode is set to "off".

Bug Fix: Fixed bug that caused code within finally clause to be marked as unreachable if there was no except clause and the code within the try block always raised an exception.

Bug Fix: Fixed bugs in ParamSpec logic. It was not properly handling the case where the target callable type contained keyword-only or positional-only parameter separators.

Bug Fix: Added support for `tuple` and `type` subscripts when `__future__` annotations is defined.

Bug Fix: Fixed bug that caused improper errors when using new-style union syntax with `from __future__ import annotations`.

Bug Fix: Worked around a reported bug in node 14+ on Linux where calls to fs.watch throw an exception when creating a recursive file watcher. The workaround is to catch the exception and proceed without a file watcher in place.

Enhancement: Updated typeshed stubs to the latest.

1.1.84

Bug Fix: Fixed parser crash when an f-string contained an empty expression.

Bug Fix: Fixed bug that caused diagnostics with "information" severity to be reported as "warnings" in the CLI version of pyright.

Bug Fix: Fixed recent regression in handling type evaluations for "and" and "or" operators. Short-circuiting evaluation was not handled correctly in some cases.

Bug Fix: Fixed bug in parser that caused expressions within f-strings to be handled incorrectly if they contained syntax errors.

Bug Fix: Fixed bug in parsing of annotated variable assignments. It was not allowing yield expressions on the right-hand side.

Enhancement: Added special-case logic to handle `isinstance` call when the first argument is a TypedDict and the second argument is a `dict` class. A TypedDict does not derive from `dict` from the perspective of type checking, but at runtime, `isinstance` returns True. This affects both type narrowing logic and checks for unnecessary `isinstance` calls.

Bug Fix: Fixed bug in type narrowing logic for expressions of the form "type(x) is y" or "type(x) is not y". The logic was incorrectly narrowing the type in the negative ("else") case. And in the positive case, it was not properly handling cases where x was a subclass of y.

Bug Fix: Fixed bug that caused completion suggestions to be presented when typing a period within a comment on the first line of the file.

Enhancement: Improved signature help for data classes where default values are specified.

Bug Fix: Fixed bug in NamedTuple logic that caused spurious errors when attempting to assign a NamedTuple to a Tuple with a compatible set of type arguments.

Page 52 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.