Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 60 of 81

1.1.40

Enhancement: Completion provider now supports auto-import for modules rather than just symbols within modules (i.e. "import X" form in addition to "from X import Y").

Bug Fix: Fixed bug that caused type guards not to work properly in some cases where an assignment expression (walrus operator) was used within the conditional statement and the value assigned to the target symbol involved a function call.

Bug Fix: Fixed bug that caused "|" operator used with variables of type "Any" to be incorrectly interpreted as union syntax.

Enhancement: If the pythonPlatform or pythonVersion are not specified, they are now initialized based on the current platform and configured python interpreter.

Bug Fix: Fixed bug that incorrectly flagged as an error some usage of a named exception symbol within an except clause.

Bug Fix: Changed logic for tracking incomplete types within the code flow engine. This fixes a bug in code flow analyzer that caused false positive errors to be reported in some cases involving loops.

Enhancement: Added localization mechanism for strings used in diagnostic messages and code actions. Strings are not yet localized, but this sets the stage for future improvements.

Bug Fix: Fixed bug that caused incorrect translation of a file offset to a line/col if the position was after the last character in the file. If a diagnostic range covered this final character, it was shortened by one character.

Enhancement: Diagnostics for reportUnknownParameterType rule are now suppressed if the parameter is named "_".

Bug Fix: Fixed bug in reportUnnecessaryIsInstance rule that triggered an inappropriate error when the target class was derived from a base class that was unknown (e.g. due to an import resolution failure).

1.1.39

New Feature: Added support for Python 3.9 "Annotated" feature described in PEP 593.

Enhancement: Expanded special-case code in parser to handle t.Literal (as well as typing.Literal) as a way of identifying use of the built-in "Literal" symbol.

Bug Fix: Fixed bug in binder that caused targets of assignment expressions (walrus operator) to appear as "Unknown" type in some cases.

Enhancement: Added support for module-level __getattr__ method, used in type stubs to indicate incomplete definitions.

Behavior Change: Removed reportTypeshedErrors diagnostic rule. It no longer makes sense given how errors are being reported.

Bug Fix: Fixed regression introduced in 1.1.38 that caused type analysis errors to be reported for source files that "shadow" type stub files for the purpose of displaying doc strings. These errors were not only displayed but were persistent even after the file was closed in the editor.

Enhancement: Changed the type of "self" and "cls" parameters to use synthesized type variables that are bound to the type of the enclosing class. This allows subclasses to call these methods and replace self and cls with their own subclass type.

New Feature: Implemented support for Python 3.9 TypeAlias feature as described in PEP 613.

Bug Fix: Added logic to avoid using unreachable assignments when inferring the effective type of a variable. This avoids creating false cycles when resolving types for symbols that depend on each other.

1.1.38

Bug Fix: Fixed bug that caused unaccessed variable diagnostics to go unreported in "for" clause of list comprehensions.

Bug Fix: Fixed errant "unbound variable" and "unknown type" messages that result from particularly complex cyclical analysis dependencies.

Bug Fix: Fixed bug in generic class type matching. TypeVars from different levels of a class hierarchy were getting conflated.

Bug Fix: Fixed bug related to specialization of a type alias definition that consists of a partially-specialized class.

Enhancement: Added support for ClassVar as specified in PEP 526 and 544.

Enhancement: Added logic to ensure that a TypeVar or ParameterSpecification is assigned to a variable of the same name used within the constructor call.

Bug Fix: Fixed bug in completion suggestions where inappropriate auto-import suggestions were sometimes presented when multiple execution environments are defined.

Bug Fix: Changed code to allow ParameterSpecification to be passed as a type arg to a generic class.

Enhancement: Tightened the check for unknown member types. Previous logic didn't check for unknown member types when member accesses in all cases.

Enhancement: If a type stub doesn't specify a return type for a function or method, assume that it's "Unknown" rather than "Any".

Enhancement: Updated stdlib typeshed stubs to the latest.

Enhancement: Added third-party typeshed stubs.

New Feature: Hover text, signature help, and completion now uses doc strings from source code if types come from a type stub file but doc strings are not found in the stub.

Bug Fix: "Find All References" no longer shows references within library implementations (other than the primary declaration).

Enhancement: Diagnostic severity level for individual diagnostic rules can be set to "information" (in addition to "none", "warning" and "error").

New Feature: python.analysis.diagnosticSeverityOverrides setting in VS Code can be used instead of pyrightconfig.json to specify severity overrides for specific diagnostic rules.

1.1.37

Bug Fix: Fixed bug that caused incorrect type analysis for a property provided by a specialized form of a generic subclass.

Bug Fix: Fixed bug in auto-import logic for the case where the completed symbol is a submodule within a top-level module.

Enhancement: Added support for ".so" and ".dylib" native module files.

Enhancement: Changed code that prints types (e.g. for hover text) to use "Any" instead of "Unknown" when typeCheckingMode is "off". Also avoided printing type arguments when they're all Any or Unknown when typeCheckingMode is "off".

Bug Fix: Changed code that infers the return type of a coroutine (async) function that never returns. Previously, it inferred the type as "NoReturn", but it now infers "Awaitable[NoReturn]".

Bug Fix: Fixed a bug in the handling of overloaded functions. PEP 484 indicates that type checkers should ignore the final non-decorated function when matching a call against a series of overloaded variants for a function.

Enhancement: Updated typeshed fallback stubs from the typeshed repo.

Enhancement: Use new PEP 604 notation for unions in hover text rather than older "Union" and "Optional" syntax defined in PEP 484.

Enhancement: Added support for new setting python.analysis.diagnosticMode. This replaces the now-deprecated setting pyright.openFilesOnly.

Enhancement: Added support for new setting python.analysis.stubPath. Changed the config setting "typingsPath" to "stubPath" for consistency. The config setting "typingsPath" is now deprecated and will eventually be removed.

New Feature: Added support for the Python 3.9 feature described in PEP 612: ParameterSpecification.

Enhancement: Allow comment-based type annotations to use forward references without using string literals.

1.1.36

Bug Fix: Fixed bug that caused auto-import to insert import statements in the wrong place when local typings stubs are used. These imports were treated as part of the local group rather than third-party.

Enhancement: Added support for runtime_checkable decorator, as defined in PEP 544.

Enhancement: Implemented support for enum literals.

Enhancement: Implemented support for type narrowing for == or != comparisons for types that can be decomposed into a limited number of literals (bool and enum).

Enhancement: Updated heuristics that are used to determine which type to use for constructor calls. In some cases, it's preferable to use the specialized type derived from the call to `__init__`. Other times, it's preferable to use the type derived from the call to `__new__`.

New Feature: Added support for the upcoming PEP 604 alternative notation for unions.

Bug Fix: Fixed bug that caused incorrect error to be reported when assigning a value to an expression involving an index operator (e.g. a[x] = b) where the indexed value had a `__setitem__` overload with an unannotated set of parameters.

Enhancement: Improved error messages related to argument matching. The message now includes the corresponding parameter name and function, which is sometimes not obvious from the context (e.g. in the case of operator overloads or other magic methods).

New Feature: Added support for python.analysis.extraPaths setting.

Enhancement: Accept minor versions in version_info when evaluating static expressions.

Enhancement: Added code to verify that resource manager type implements `__exit__` or `__aexit__` in addition to its enter counterpart.

Bug Fix: Fixed regression that caused diagnostics not to be cleared when closing a source file in the editor and openFilesOnly is enabled.

Bug Fix: Fixed bug in auto-import feature of type completion where imported module name included "-stubs" on the end if the symbol was resolved to a companion stub package.

Enhancement: Introduced reportUnboundVariable and reportUndefinedVariable diagnostic rules.

Bug Fix: Fixed bug that caused file changes not to trigger reanalysis in some cases.

Bug Fix: Special-cased FunctionType and LambdaType to avoid emitting false positives for the reportUnnecessaryIsInstance rule.

1.1.35

New Feature: Added support for "python.analysis.autoSearchPaths" setting. If enabled (as it is by default), it automatically adds "src" to the import search paths. It is common for workspaces to contain a directory by this name.

Bug Fix: Fixed bug that caused the type arguments for a bare "Callable" to be treated as Any rather than Unknown. This resulted in some missed "partially Unknown" errors.

Enhancement: Fixed perf bug that caused large numbers of empty diagnostic reports to be sent to the language client when the openFilesOnly was enabled.

Bug Fix: Don't dirty a source file and its dependencies just because we receive a file system change event. This is especially important if the file is already open, in which case file system change events are ignored.

Enhancement: Changed generic type specialization code to treat unspecified type arguments as Unknown (Any) in cases where the TypeVar is constrained.

Bug Fix: Fixed bugs in "find references" logic (which is also used for "rename symbol"). It wasn't properly handling locally-aliased import names.

Enhancement: Dramatically sped up "find references" and "rename symbol" operations.

Bug Fix: Fixed a bug in hover provider where it didn't show the proper type for an imported symbol with a local alias name.

Bug Fix: Fixed bug that caused "find references" and "rename symbol" to stop working for member variable names outside of the current file.

Bug Fix: Fixed bug where a string literal used within the first argument of a Callable was interpreted as a string rather than a forward-declared type.

Bug Fix: Fixed recent regression where parameter types for functions declared using Callable were omitted in the hover text.

Enhancement: Enhanced the type narrowing logic for isinstance to narrow the type of an Any or Unknown variable to the target type (for positive tests only).

Bug Fix: Added code to prevent "Rename symbol" from renaming symbols in library code or third-party type stubs.

Enhancement: Added cancelable progress dialog for "Find All References" and "Create Type Stubs" commands.

Bug Fix: Fixed recent regression that caused deleted files within a workspace not to cause re-analysis as appropriate.

Enhancement: Changed "organize imports" to follow formatting rules of "black" formatter for multi-line imports.

Page 60 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.