Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 63 of 81

1.1.22

Behavior Change: By default, the "reportMissingTypeStubs" setting now defaults to "warning" instead of "none". As before, it is an "error" in strict mode. Type checkers like Pyright provide significantly more value when you have type stubs available. For more details about why type stubs are important and how to locate or generate type stub files for your project, please refer to [this documentation](https://github.com/microsoft/pyright/blob/master/docs/type-stubs.md).

Bug Fix: Avoid reporting "partially unknown" error for functions that include "*" parameter.

Bug Fix: Fixed logic that converts function types to a string (for hover text, error messages, etc.). It wasn't correctly handling the 'position-only' argument separator ('/') introduced in Python 3.8.

Bug Fix: Fixed bug in binder logic that resulted in infinite recursion in the type evaluator. It occurred in the case where the target of an assignment was a tuple and the elements in the tuple depended on assignment ordering. The binder was not assigning the correct control flow nodes to the individual elements of the target tuple.

Bug Fix: Fixed bug in type evaluator relating to type var matching for function calls. The code now "locks" the type var map after the first pass. In the second pass, it verifies that the arguments are compatible with the types associated with the (now-locked) type vars.

Bug Fix: Fixed bug in type evaluator where it not properly handling properties within protocol classes.

Bug Fix: Fixed translation of a heterogenous tuple into an iterator. The resulting iterator needs to have a type argument created from a union of the heterogeneous tuple entries.

Enhancement: Added error reporting for instance and class variables within methods declared in a Protocol class. PEP 544 indicates that these should be flagged as an error.

Bug Fix: Fixed bug in type check logic that determines whether a class conforms to a Protocol. It was not properly taking into account instance variables within the class.

Bug Fix: Fixed bug in handling of "cast" function when type is specified within a string literal.

Enhancement: Added type narrowing support for built-in "callable" call.

1.1.21

Bug Fix: Fixed a ~5% performance regression that was introduced in 1.1.18 relating to abstract method checks.

Enhancement: Improved completion handling within decorators.

Enhancement: Added support for forward-declared types within contexts other than type annotations. This includes the 'bound' parameter and constraints within a TypeVar declaration, type arguments, the first argument to a "cast" call, and type expressions found within a "NamedTuple".

1.1.20

Enhancement: Implemented support for "Final" type annotation introduced in Python 3.8.

Bug Fix: Fixed bug in type comparison logic. It wasn't taking into account specialized return types for functions, so unions that contained two functions with different specialized return types were being deduped incorrectly.

Bug Fix: Fixed a bug in member access evaluation where the base type was a generic class. The logic was inappropriately specializing the class, inserting "Unknown" type arguments.

Bug Fix: Enhanced TypeVar matching logic to handle the case where the first encounter with a TypeVar is contravariant but subsequent encounters are covariant or invariant, in which case we may be able to narrow the type from the initial guess.

1.1.19

Enhancement: Added support for imaginary number literals (e.g. "3.4j").

Enhancement: Added new configuration setting reportImplicitStringConcatenation that generates errors or warnings when implicit string concatenation (multiple string literals in a row) are used.

Enhancement: Added type constraint support for conditional expressions that include assignment (walrus) operators.

Bug Fix: Fixed a bug in parser and a bug in completion provider that impacted completion suggestions within decorators.

Bug Fix: Fixed bug in TypeVar matching logic for case where a union includes multiple types, some of which are subclasses of the other.

1.1.18

Enhancement: The reportUnknownVariableType setting now also checks for unknown or partially-unknown types in return type declaration and return value expressions.

Enhancement: Added new setting reportUnknownArgumentType that emits an error or warning when an argument's expression type is unknown or partially unknown. This setting is enabled in strict mode.

Bug Fix: Changed type checker to enforce invariance of type arguments where appropriate. This includes union types.

Bug Fix: Fixed bug in bidirectional type inference in case where provided object was subclassed from the expected type's class.

Bug Fix: Fixed bug in speculative evaluation mode where cached types from older speculative sessions were still being used in newer speculative sessions, giving the wrong answer.

Bug Fix: Fixed logic for detecting abstract methods that are not overridden. The previous logic didn't work when a mix-in class provided the implementation.

1.1.17

Enhancement: Updated to the latest version of typeshed type stubs.

Enhancement: Added support for PEP 562's __getattr__ function.

Bug Fix: Fixed bug in handling of Protocol classes with generic type arguments.

Bug Fix: Fixed signature provider so it works with decorator calls.

Bug Fix: Fixed bug in type checking logic for homogenous tuples of arbitrary length.

Page 63 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.