Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 61 of 81

1.1.34

Bug Fix: Fixed crash on startup that several users reported.

Bug Fix: Fixed bug that masked errors in strict mode where parameter types were not declared.

Bug Fix: Fixed bug that caused errant "not derived from BaseException" error if base class type was unknown.

Enhancement: Parser now reports error when "return" statement is used outside of a function.

Enhancement: Improved responsiveness of type completion suggestions.

New Feature: Add diagnostic for missing imported source file (reportMissingModuleSource).

1.1.33

Bug Fix: Fixed bugs in type analyzer relating to assignments of tuples when target uses an "unpack" operator.

Bug Fix: Fixed race condition that resulted in spurious (but temporary) diagnostics to be reported when there was an open file when VS Code started.

Bug Fix: Fixed bug in type evaluator where literals were being inappropriately stripped from type arguments in certain assignments.

Enhancement: Changed text representation of function declarations to omit extra spaces around "=" for default value assignments when type annotations are not used (consistent with PEP8 guidelines).

Enhancement: Added __dataclass_fields__ class variable to synthesized data classes.

Enhancement: Moved type analysis to background process and added cancellation for better responsiveness.

1.1.32

Enhancement: Updated typeshed stubs to latest version from typeshed repo.

Bug Fix: Fixed small bug in signature helper provider.

Bug Fix: Fixed crashing bug when type checker encountered a dictionary comprehension that was not the first entry in a dictionary literal.

Enhancement: Added syntax error for comprehensions used within set or dictionary literal that are not the first and only entry.

Bug Fix: Removed code that verifies that a slice object has ranges defined by 'int' types. Slices can support other types as well.

Enhancement: Added type narrowing logic for conditionals that involve comparisons between Literal expressions such as "animal: Literal['cow', 'horse'] \ if animal == 'cow'"

New Feature: Implemented new setting "pyright.disableOrganizeImports".

Bug Fix: Fixed bug in constructor argument validation logic. If there was no init or new method in the class, argument expressions were not being evaluated. This led to errant "unreferenced symbol" errors.

Bug Fix: Fixed type checker's handling of "yield from" statement. It wasn't correctly handling iterable expressions.

Enhancement: Added code to validate that type arguments used to specialize a generic union type alias match the type variable constraints and bounds. Also validated that the correct number of type arguments are provided in this case.

Bug Fix: Fixed bug where unresolved imports with alias (i.e. "import x as y") resulted in errant "y is unbound" errors if y was used in an execution scope other than the one in which the import was located (e.g. within a function).

Bug Fix: Fixed bug in function signature code that caused incorrect errors to be reported related to function overload resolution.

1.1.31

Enhancement: Add contextual signature help that handles overloads and arbitrary ordering of named parameters.

Bug Fix: Fixed bug in code that determines whether an instantiated class is abstract. It was not properly taking into account MRO (method resolution ordering) for the class.

Bug Fix: Another attempt to work around the file watcher issues on Mac OS X.

Enhancement: Added special-case handling for type var matching of Optional[T].

Enhancement: Added new pyright.typeCheckingMode setting for VS Code extension that allows you to set the default rule set for type checking. Three values are supported: "off", "basic", and "strict". This setting can be overridden in the pyrightconfig.json file with the typeCheckingMode config key.

Enhancement: Changed text representation of functions to omit "Unused" parameter type annotations. This makes hover text and completion suggestion text more readable in code bases that are lacking type annotations.

Enhancement: Added "reportGeneralTypeIssues" setting, which is set to "error" by default. Users can optionally change it to "warning" or "none".

1.1.30

Bug Fix: Prevent reporting of redundant errors and warnings.

Bug Fix: Fixed bug that caused forward-referenced type annotations within data class definitions to be reported as "unbound" even if the "annotations" futures flag was enabled.

Bug Fix: Fixed handling of Tuple[()], which should be interpreted as a zero-element tuple according to PEP 483. Fixed assignment compatibility check for zero-element tuples.

Bug Fix: Changed class-member lookup logic to better handle the case where one of the base classes is unknown. It previously stopped when it encountered an unknown base class. Now it scans all known base classes first.

Bug Fix: Fixed bug where Any or Unknown type incorrectly resulted in an "is not valid iterable" error.

Enhancement: Improved type analysis performance, especially in cases where code contains no type annotation, so return types and instance variable types need to be inferred.

Enhancement: Improved responsiveness by adding cancellation support for hover, completion suggestions, and other language server requests.

Enhancement: Added support for built-in `__dict__` symbol within module.

Enhancement: Added more helpful error message for missing `__enter__` method if there is an `__aenter__` method present.

Enhancement: Added checks for disallowed usage of Final as specified in PEP 591.

Enhancement: Normalized all diagnostic messages to use the same terminology, tense, and quote symbol.

Enhancement: Added code to hover provider to print the constructor input parameters for a class that is being instantiated.

Enhancement: Hover text for functions no longer print "Unknown" type for input parameters if type annotations are not present. This makes the hover text more readable.

1.1.29

New Feature: Virtual environment detection ensures that virtual environments are excluded from analysis by default if the virtual environment is located within the workspace directory.

Enhancement: Hid type arguments and type parameters when printing types related to pseudo-generic classes. Since these type parameters are internally synthesized, they are confusing for users to see.

Bug Fix: Fixed several bugs in the logic that handles type matching of functions. It wasn't properly taking into account name-only and position-only markers in parameter lists.

Bug Fix: Fixed a few bugs in logic that determines whether to report diagnostics for a given source file. Diagnostics were previously suppressed for type stubs found in the "typings" directory but should not have been. Diagnostics were also suppressed for local source files that are imported by included files. And diagnostics were not properly added or cleared when a file was opened and the "openFilesOnly" setting was in effect.

Bug Fix: Fixed recent regression that caused a crash when using the "find references" or "rename symbol" features.

Enhancement: Added additional diagnostic context for type var assignments so it's clear whether the type var is invariant, covariant, or contravariant.

Bug Fix: Fixed bug in TypeVar matching logic for functions when a later parameter's generic type influenced the type of an earlier parameter. This situation requires multiple passes to resolve all type variables properly.

Page 61 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.