Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 41 of 81

1.1.156

Bug Fix: Fixed false positive error related to member access of optional type.

Bug Fix: Fixed false positive error related to an escape sequence (backslash) used in an f-string format specifier.

Bug Fix: Fixed false positive error with f-string format specifier that contains an expression within braces and also a colon specifier.

Enhancement: Updated typeshed stubs to latest version.

Bug Fix: Fixed false positive error when evaluating a subscript (index) operation with an index value that is a union type and an overloaded `__getitem__` method that requires union expansion.

Enhancement: Added new check for a function overload that contains an implementation.

Enhancement: Added special-case handling for addition of two tuples that have known lengths.

Bug Fix: Fixed bug in check that detects improper variance for type variables used within generic protocols. Class or instance variables within a generic protocol must use invariant type variables.

Enhancement: Improved heuristics for type matching when source and dest types are unions and invariance is being enforced — specifically in the case where the destination union type includes generic types.

1.1.155

Bug Fix: Fixed recent regression that resulted in false positive errors when a class declaration used both `Type[X]` and `X` in its specialization of base classes.

Bug Fix: Fixed false positive error related to `isinstance` narrowing of a non-constrained TypeVar.

Bug Fix: Changed encoding of literals in error messages to avoid including raw (unescaped) special characters in output.

Behavior Change: Increased maximum source file size from 16MB to 32MB.

Enhancement: Improved formatting of error messages that include expressions — specifically when the expression includes an empty dict ("{}").

Bug Fix: Fixed false positive error for the case where a function with positional/keyword parameters is assigned to a callback protocol that accepts only keyword parameters.

Enhancement: Added support for member access expressions for the `None` object.

Enhancement: Added support for `isinstance` and `issubclass` type narrowing where the variable type and the test type have no apparent relationship. The type evaluator synthesizes a class that is a subclass of both types — effectively an "intersection" of the two.

Behavior Change: Modified `reportUnnecessaryIsInstance` diagnostic to never report always-false conditions because the type checker no longer generates such conditions.

1.1.154

Removed support for undocumented "mspythonconfig.json" config file name. This was previously available as an alternative to "pyrightconfig.json", but we've decided to standardize on the latter.

Bug Fix: Changed logic for "overload missing implementation" check to not require an implementation within a protocol class.

Enhancement: Updated typeshed stubs to latest version.

Bug Fix: Fixed confusing error message when file or directory is specified on command line but is excluded by the "exclude" section of the config file.

Behavior Change: Exempt classes from `__slots__` check if they explicitly declare an empty slots. This is commonly used for mix-in classes that are compatible with slotted classes.

Internal Change: This version of pyright includes a significant change within the type evaluator that simplifies the code and eliminates a major source of bugs related to the handling of `Type[X]` type annotations.

1.1.153

Bug Fix: Fixed type evaluation bug where `Callable` is used to annotate an input parameter, and the `Callable` return type is a union that contains a type variable and the type variable is used within a nested function.

Bug Fix: Fixed bug in "isinstance" type narrowing logic and in the "unnecessary isinstance" diagnostic check when the type being narrowed is a runtime-checkable protocol instance.

Bug Fix: Fixed bug in type evaluator that resulted in a false positive error when a `__getattr__` was supplied in a metaclass, and it returned a generic callable type.

Enhancement: Added validation for assignment of instance variables that are not declared in `__slots__`.

Enhancement: Added check for class variables that conflict with an instance variable declared in `__slots__` within a class.

Behavior Change: When displaying overloaded functions in hover text, filter out the implementation signature.

Bug Fix: Fixed bug in code flow engine that caused incorrect type evaluation of complex expression that appears multiple times within a function in contexts where `isinstance` type narrowing generates different types for the same expression.

1.1.152

Bug Fix: Fixed false positive error involved in the instantiation of `type(self)()` within an abstract class.

Bug Fix: Fixed parser bug that caused completion provider to not work correctly when completing relative imports ending in a dot.

Bug Fix: Fixed bug that led to false positive error related to dictionary unpacking when the argument type is a type variable.

Bug Fix: Fixed false positive error when using `del` keyword with a tuple expression.

Bug Fix: Fixed bug in completion provider where it was interpreting prior quotes incorrectly when completing a typed dictionary key, most easily reproducible when using nested typed dictionaries.

Bug Fix: Eliminated false positive error for `Final` when it doesn't include a type argument.

Bug Fix: Fixed several possible causes of stack overflow crashes in the type evaluator.

Bug Fix (from pylance): Fixed bug in completion provider related to dictionary key completions that contain non-alpha characters.

Bug Fix: Fixed false positive error when `super()` was used in a static or class method and the target function in the base class had an annotated cls parameter.

1.1.151

Enhancement: Added support for metaclasses that support the `__getitem__`, `__setitem__` and `__delitem__` magic methods, allowing classes that derive from these metaclasses to be used in index expressions.

Bug Fix: Fixed bug that caused dataclass usage to break in Python 3.6 and older when using the polyfill library.

Enhancement: Added conditional type support for `__setitem__` so a value with a type defined by a constrained TypeVar can be assigned to an index expression.

Bug Fix: Fixed bug that caused a crash in the tokenizer when encountering a string literal that is extremely long (>100K in length).

Bug Fix: Fixed bug caused by a variable assignment with a list expression on the RHS that was interpreted temporarily as a type alias declaration. Added more sanity checking on the type of the assigned expression for type aliases.

Bug Fix: Fixed type evaluation bug where `Callable` is used to annotate an input parameter, and the `Callable` return type is a union that contains a type variable.

Bug Fix: Fixed bug in constraint solver relating to replacement of return type of the form T when matching was performed against Type[T].

Enhancement: Added support for `__builtins__` module symbol symbol.

Enhancement: Added support for type narrowing conditional expressions of the form `a is False`, `a is True`, `a is not False` and `a is not True`.

Page 41 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.