Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 59 of 81

1.1.46

Enhancement: Added checks to ensure that type annotations contain only class types, not instantiated objects.

Enhancement: Added code to filter out duplicate "pseudo-generic" types in unions when printing them. We omit the type arguments when printing pseudo-generic types, so without this filtering, we were seeing seemingly-duplicated types.

Enhancement: Added support for literal type aliases used within Literal type arguments.

Bug Fix: Fixed bug in handling of unpack operator when used as an assignment target. It should be typed as List, not as Iterable.

Bug Fix: Fixed recent regression that affected the logic that combines Literal[True] and Literal[False] into bool.

Enhancement: Added support for several "type" metadata fields that are accessible on classes that derive from type. This includes `__subclasses__`, `__module__`, etc.

Enhancement: Added more trace logging to output pane.

Bug Fix: Fixed bug in hover text. Sometimes hovering over a module import target didn't display the module-level doc string.

Enhancement: Added severity level enum to package.json so it is editable within the VS Code settings UI.

1.1.45

Bug Fix: Fixed bug in call hierarchy provider that caused aliased symbols to be reported incorrectly.

Enhancement: Added support in call hierarchy provider for properties.

Bug Fix: Improved handling of dataclass entries that use "field(init=False)" to specify that the field should not be included in the synthesized `__init__` method's parameter list.

Enhancement: Added support for the new Python extension setting for pythonPath. This mechanism replaces the soon-to-be-deprecated "python.pythonPath" setting.

Bug Fix: Nested lists were not properly passing through the expected subtype if it included a union.

Bug Fix: Fixed bug that caused a use of Final within a dataclass to be flagged as an error.

Bug Fix: If left unspecified Pyright is meant to assume the Python version and platform from the currently-selected interpreter. This wasn't correctly set if there was no pyrightconfig.json config file.

1.1.44

New Feature: Added call hierarchy provider, which allows the client to display all callers of a function or all calls made by a function.

Bug Fix: Fixed bug in code that scans for source files within the project that caused an infinite loop if it encountered a symbolic link that created a cycle.

Bug Fix: Changed logic that computes union types to strip out NoReturn types if they are combined with other types. A "NoReturn" should always appear by itself, never in a union.

Enhancement: Improved error messages for argument type mismatches.

Bug Fix: Fixed bug that caused code to be marked as "unreachable" if a lambda declaration involves a call to a NoReturn function.

Bug Fix: Added missing support for `__rmatmul__` (reverse matrix multiply) operator overload method.

Bug Fix: Fixed bug in the handling of code actions that appear in the first line.

Enhancement: Make logging level to Output configurable.

Enhancement: Improved auto-import feature so it now handles auto-imports of all installed packages instead of only those that have been referenced previously within the project.

Bug Fix: Fixed docstring fetching in relative import cases, `-stub` packages.

Bug Fix: Fixed bug that caused an internal error when typing certain decorators at the module scope.

Enhancement: Added support for unpacking of tuples with specified element types within argument lists. The type checker now properly expands these tuples and matches individual element types against corresponding parameters in the callee.

Enhancement: Improved error messages for TypeVar mismatches (e.g. invariance).

Enhancement: Extended bidirectional type inference to function call expressions where the callee has a declared return type that is generic.

1.1.43

Bug Fix: Fixed bug in type inference for list comprehensions. It should inter the type AsyncGenerator rather than Generator if the comprehension uses the "async" keyword.

Bug Fix: Fixed bug that caused overloaded function and class decorators to generate errors inappropriately.

Bug Fix: If a module cannot be resolved during type analysis, treat the symbol as "unknown" rather than "unbound" so usage of that symbol doesn't result in further errors.

Bug Fix: Fixed bug that generated incorrect error when a function declaration used a parameter with no default arg value after a parameter with a default arg value after a var-arg parameter.

Bug Fix: Fixed bug in handling of negative integers when used as Literal type arguments.

Enhancement: Updated typeshed stub files to the latest.

Enhancement: Added support for alternate syntax for TypedDict that uses named arguments rather than a single dictionary argument.

Bug Fix: Fixed bug where hover type of annotated variable was disclosed as "Unknown" if there was no assignment to that variable. It should display the annotated type.

Bug Fix: Fixed bug that caused the hover text for named arguments used to initialize a dataclass to indicate that the type was "Any" rather than the correct type.

Enhancement: Improved error messages for dictionary statements that are assigned to TypedDict variables or function arguments.

Bug Fix: Fixed a bug in code flow analysis logic that caused type to be evaluated as Never.

1.1.42

Enhancement: Added diagnostic for objects that are called but do not have a __call__ method.

Bug Fix: Fixed bug that caused call arguments to not be evaluated (and therefore not type checked or marked accessed) if certain errors were detected while evaluating types for a call expression.

Enhancement: Added logic to avoid doing a complete reanalysis when a temporary file is momentarily created by an auto-formatter like Black.

Bug Fix: Fixed bug that caused some illegal uses of "Final" (as defined in PEP 591) to not be reported.

Bug Fix: Avoid duplicate imports in completion results.

Bug Fix: Fixed bug in dataclass logic so it properly excludes ClassVar entries as per PEP 557.

Bug Fix: Fixed bug in code flow logic for handling certain assignments within loops where the same symbol is on the left and right side of the assignment.

1.1.41

Enhancement: Added type guard support for conditional expressions of the form (x := expr) is None and (x := expr) is not None.

Enhancement: Added logic to "gray out" code after a call to a "NoReturn" function to indicate that the code is unreachable.

Bug Fix: Fixed bug that resulted in a crash if a type annotation on an instance variable referred back to the variable itself.

Bug Fix: Fixed bugs in a couple of localized strings.

Bug Fix: Fixed bug that caused private variables to be reported as unaccessed in cases where they were.

Bug Fix: Fixed hole in exception handling within type evaluator that could leave the control flow graph in an inconsistent state if a cancellation exception occurred at the wrong time.

Bug Fix: When typeCheckMode is set to "off", avoid displaying "Any" twice within a Union (due to "Unkown" being reported as "Any").

Enhancement: Improved support for nested finally clauses.

Enhancement: Hover results for named parameter at call site now displays the expected parameter type rather than the provided argument type.

Bug Fix: Fixed compliance with PEP 557 which says that fields without type annotations shouldn't be considered as data fields within a data class.

Bug Fix: Fixed bug in chained comparison expression handling (e.g. a < b < c) that caused the left half of the expression not to be type checked.

Page 59 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.