Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 39 of 81

1.1.168

Bug Fix: Fixed inconsistency in the constraint solver with respect to literal types. They were being retained for most classes but not for tuples.

Bug Fix: Fixed bug in parser that resulted in a false negative when a `for` keyword (in either a `for` statement or a list comprehension) was followed immediately by `in` keyword.

Behavior Change: Enforce PEP 484 rules for symbols that are imported by a stub file but are not meant to be re-exported. These symbols are no longer resolved when accessed outside of the module, nor are they included in completion suggestions or other language service providers.

Behavior Change: Modified logic for private symbols (whose names begin with an underscore) exported from a stub file or a py.typed source file; if the symbol is explicitly included in `__all__` it is not considered private.

Enhancement: Added reportPrivateImportUsage diagnostic rule, which reports usage of a symbol from a py.typed library that is not intended to be re-exported by the library's author. The rule is on by default in basic type checking mode but can be disabled. Completion provider no longer offers these symbols as completion suggestions.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when co-dependent variables were assigned in a loop using tuple assignments (e.g. `a, b = b, a + 1`).

Bug Fix: Improved `isinstance` and `issubclass` support to handle the case where the type of the second argument is a union where the subtypes includes both tuples of class types and non-tuples.

Enhancement: Updated typeshed to latest version

1.1.167

Bug Fix: Fixed regression that caused a false positive error when an overload implementation annotates a parameter with a union that includes a type variable.

Enhancement: Added support for type annotations that are enclosed in triple quotes.

Bug Fix: Fixed false positive error when a class declaration inherits from `Protocol` and `Generic`.

Bug Fix: Fixed bug that resulted in a missed error (false negative) when comparing an overload implementation with an overload signature that uses a generic return type.

Enhancement: Added support for a `super()` call made within a class method or instance method where the `cls` or `self` parameter is explicitly annotated (e.g. with a bound type variable).

Enhancement: Extended isinstance type narrowing logic to support `Callable`.

Enhancement (contribution from Matt Hillsdon): Reduced cascading parser errors when a colon is omitted before an indented code block.

Bug Fix: Fixed incorrect type evaluation for ternary, list and dictionary expressions in certain cases where the expression is within a loop.

Bug Fix: Fixed bug in control flow engine that resulted in incomplete types in certain cases that involved loops and circular type dependencies.

1.1.166

Bug Fix: Fixed a false positive error (and crash) when a walrus operator (assignment expression) is used within a list comprehension which is passed as an argument to a function decorator.

Bug Fix: Fixed stack overflow crash in type analyzer.

Bug Fix: Fixed incorrect evaluation of recursive type alias whose definition uses a `TypeAlias` annotation.

Enhancement: Improved error messages for type argument count mismatch; they were referring to a "class", but sometimes they were used for type aliases as well.

Bug Fix: Fixed bug that resulted in the incorrect specialization of a type alias that includes a ParamSpec.

Bug Fix: Fixed bug in type verifier that resulted in incorrect reporting of an unknown type when a type alias was defined using a `TypeAlias` annotation.

Enhancement: Extended dataclass_transform mechanism to support implicit `init` argument values for field descriptors.

Bug Fix: Fixed false native that incorrectly allowed a union type to be assigned to a constrained TypeVar.

Bug Fix: Improved handling of class properties (i.e. properties that have classmethod applied to them). The `cls` parameter for the property method is now properly passed the class as an argument.

Enhancement (contribution by Marc Mueller): Adjust auto-import sorting to better match isort.

Bug Fix: Fixed bug in overlapping overload detection logic that resulted in false positives in some cases.

Bug Fix: Fixed a bug that resulted in unsolved TypeVars in certain edge cases involving function type compatibility checks.

Bug Fix: Improved handling of constrained type variables that use a union in one or more constraints.

Bug Fix: Fixed bug that resulted in a false positive error when a call involves overloads and one or more of the arguments involves another call expression whose type is generic, and therefore influenced by bidirectional inference context.

1.1.165

Bug Fix: Fixed false positive error due to incorrect type of the `__doc__` instance variable. It should be `str | None`, but it was hard-coded to be `str`.

Bug Fix: Fixed a bug that resulted in a false positive type error when an instance variable's type depended on itself in a circular reference within a loop.

Bug Fix: Fixed false positive error when a binary operation uses `None` on the LHS and the RHS is a type that accepts `None` to a reverse operator overload method.

Bug Fix: Improved logic that determines whether a type is iterable. The old logic didn't support unions of iterable types.

Bug Fix: Improved handling of call expressions to functions that return NoReturn.

Bug Fix: Fixed bug in recently-added type check for inherited class variable type. The check was not properly specializing the base class type.

Enhancement: Updated typeshed stubs to the latest version.

Enhancement: Added performance optimization for code flow analysis within loops.

Enhancement (from Pylance): Don't offer keywords as completion suggestions if they are not valid for the currently-selected version of Python.

Enhancement: Added check for subscripted form of `asyncio.Task` when used in certain contexts prior to Python 3.9 that generate runtime exceptions.

1.1.164

Bug Fix: Fixed false positive error when assigning an `Any` value to a member of an object that has a `__set__` method.

Enhancement: Eliminated confusing error message when nested argument expression contains a type error.

Enhancement: Improved bidirectional inference logic for lambda expressions to better handle the situation where the "expected type" is a union that contains multiple callable types.

Behavior Change: Suppressed the "obscured symbol" diagnostic check when the name of the symbol is `_`. This symbol is used in the single dispatch pattern documented in PEP 443.

Bug Fix (from Pylance): Support eggs that are not in zip files but are instead in folders.

Enhancement (from Pylance): Support pth file in extra paths.

Bug Fix: Fixed false positive error when a constrained TypeVar is used as the second argument to an isinstance or subclass call.

Bug Fix: Fixed false positive error that occurs when a `final` class derives from an abstract base class that defines no abstract methods.

Bug Fix: Fixed false positive error related to overload implementation checks when the return type of the implementation contains a Tuple annotation with a TypeVar as a type argument.

Enhancement: Added special-case handling for tuple[()] type when determining the iterated type. In this case, it can be safely evaluated as `Never`.

Enhancement: Improved error reporting for assignments to class variable assignments within a child class where the assigned value doesn't match the type of the same-named class variable declared in a parent class.

1.1.163

Bug Fix: Fixed false positive error relating to the use of a `*P.args` or `**P.kwargs` parameter as an iterable value (where `P` is a `ParamSpec`).

Bug Fix: Fixed false positive error due to incomplete tracking of incomplete types during code flow evaluation.

Bug Fix: Fixed bug with ParamSpec matching in the case where the matched function contains parameters with default values or `*args` / `**kwargs`;

Bug Fix: Fixed false positive error that results when defining a property setter within an abstract base class and the property setter references a type that has a circular reference to the class.

Bug Fix: Fixed a false positive error when handling *args and **kwargs arguments when the function contains *P.args and **P.kwargs parameters.

Behavior Change (from Pylance): When inserting new auto-import symbol, sort by symbol type to match isort default behavior.

Bug Fix: Fixed comparison operators so they use the proper opposite when looking for a type match. For example, the opposite of `__lt__` is `__ge__` rather than `__gt__`.

Bug Fix: Fixed bug that caused inappropriate type narrowing if a comparison operator was used within an argument for a call expression which was, in turn, used within an `if` condition expression.

Behavior Change: Changed the interpretation of a "callback protocol" to encompass protocols that include a `__call__` method in addition to other attributes.

Bug Fix: Fixed false positive error related to `with` statements with an expression enclosed in single parentheses.

Bug Fix: Fixed bug in type var matching when the a `cls` parameter is annotated with type `Type[T]` and `T` is bound to a protocol class.

Bug Fix: Fixed bug that resulted in ` type: ignore` comments to be ignored in the event that we hit the heap high-water mark and emptied internal caches.

Enhancement: Updated to latest version of typeshed stubs.

Page 39 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.