Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 65 of 81

1.1.10

New Feature: For functions whose input parameters are missing type annotations, Pyright can now infer the return type based on the argument types passed at the call site.

New Feature: Added new configuration option "reportDuplicateImport" that generates an error or warning when a symbol or module is imported more than once in a source file.

Enhancement: Improved type completion for import statements to filter out directory names that contain characters that are not allowed for module names (periods and hyphens).

Bug Fix: Fixed bug in tokenization of f-strings. It caused expressions within string formatting directives to go unevaluated.

Bug Fix: Fix crash caused by non-breaking space token in a module name.

Bug Fix: Fixed bug in tuple assignment logic. It wasn't properly handling the form Tuple[X, ...], which represents a tuple with arbitrary length.

Bug Fix: Fixed bug related to the type logic for dictionary expansion entries that were typed with "Dict" rather than "dict" class.

Bug Fix: Fixed bug in type completion logic that resulted in auto-imported symbols being added to import statements multiple times if they were already imported.

Bug Fix: Fixed bug in auto-import type completion logic that caused auto-imported symbol to be inserted in the wrong order if it was alphabetically first.

Bug Fix: Fixed incorrect ID in pyrightconfig schema file (a copy-and-paste bug).

1.1.9

Enhancement: Added support in completion provider for named parameter suggestions within argument lists for call expressions.

Bug Fix: Fixed bug in type var matching for contravariant type vars.

Bug Fix: Changed *args parameter to be typed as Tuple rather than List, as per the python spec.

Bug Fix: Fixed errant "unbound" error for variable that's declared in an outer execution context and referenced via a closure.

Bug Fix: Changed file system watcher logic to allocate a single chokidar watcher for all include paths rather than one each.

Bug Fix: Added default excludes of `**/node_modules` and `**/__pycache__` because these are almost never intended to be scanned for tracked source files.

Bug Fix: Changed type var matching logic for constrained type vars. The previous logic constrained types to an exact match of the specified constraints, whereas derived types should be permitted. It was based on a misreading of PEP 484.

1.1.8

Bug Fix: Fixed bug that caused properties with generic return types to not be specialized correctly.

Bug Fix: Added support for property getters, setters and deleters that have generic types for the "self" parameter.

Bug Fix: Silenced a noisy error message related to file system watcher.

Bug Fix: Added missing translation layer that translates configured platform (e.g. "Windows") into the corresponding sys.platform string (e.g. "win32").

Enhancement: Added support for type constraints of the form "X == None" and "X != None".

Enhancement: Changed the behavior of VS Code extension when no pyrightconfig.json is present. It now defaults to include all source files under the root workspace directory. This was already the behavior for the command-line version of pyright.

1.1.7

Enhancement: Added "related information" diagnostic for attempts to override methods in incompatible manner and overrides for final methods.

Bug FIx: Fixed regression in type evaluator that broke completions in cases where there was a parse error (e.g. when typing a dot as part of a partially-completed member access expression).

Bug FIx: Fixed type inference of "self" and "cls" parameters for methods in a Protocol class so they are not reported as unknown.

Bug FIx: Fixed crash due to hover provider accessing an unreachable node.

1.1.6

New Feature: Added hover, definition, reference and rename support for named arguments.

Enhancement: Made some changes that improve responsiveness during large analysis in VS Code.

Enhancement: Augmented some diagnostic messages with "related information" (e.g. a location in another file that helps explain the error or warning).

Enhancement: Improved error reporting for declaration collisions.

Enhancement: Added bidirectional type inference for yield statements.

Bug Fix: Disabled file system watcher polling on MacOS to help eliminate reports of high CPU utilization and heap overflows.

Bug Fix: Fixed bug in type checker where hovering on some expressions before the file was fully checked caused incorrect errors to be generated.

Bug Fix: Fixed type checker's handling of constrained TypeVars.

Bug Fix: Fixed a couple of bugs relating to type checking of generic protocol classes.

Bug Fix: Added missing newline character in --help output.

1.1.5

New Feature: Added support for Python 3.8 final decorator, which can be applied to both classes and methods.

Enhancement: Parser is now pickier about supported syntax for type annotation expressions.

Bug Fix: Fixed handling of 'typeshedPath' setting. The code was assuming that it was an absolute path, but relative paths should also be supported.

Bug Fix: Some Mac users have reported ongoing high CPU utilization. I suspect this is related to the file watching library used in pyright. I've made some adjustments that I hope will avoid this behavior.

Page 65 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.