Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 49 of 81

1.1.107

Bug Fix: Fixed cyclical type resolution with TypeVar.

Behavior Change: Updated typeshed stubs to new directory layout.

Bug Fix: Fixed false positive error in try/except/finally statement. Call expressions are now assumed to possibly result in raised exceptions, and finally clauses are assumed to be exception targets.

Bug Fix: Fixed regression in import resolution where the first portion of the import path matches multiple namespace packages.

New Feature: Added initial support for PEP 646 (variadic type variables). This PEP is still in the draft stage and is likely to change before it is ratified.

Enhancement: Added check for duplicate keyword arguments that map to **kwargs parameter.

Enhancement: Added support for class properties, which are now supported in Python 3.9.

Behavior: Eliminated false positive errors for unbound variables that are targets of a for loop iterator and used after the for loop. This change can result in some false negatives.

1.1.106

Bug Fix: Added missing check for empty f-string expression.

Bug Fix: Fixed a bug that resulted in incorrect bidirectional type inference when the source was a call to a constructor and the destination (expected) type was a recursive type alias that includes a union with only some subtypes that match the constructed type.

Bug Fix: Fixed two issues in the import resolution logic. First, it was returning a namespace module if it found one in the workspace path or extraPaths even if a traditional (non-namespace) module satisfied the import from the sys.path. The interpreter searches all paths and always prefers a traditional module if it can find it. Second, it was resolving a namespace module if a traditional module only partially resolved the import path. The real interpreter always prefers a traditional module even if it partially resolves the path (in which case the full import fails).

Behavior Change: When too few type arguments are provided for a generic class specialization, this diagnostic is now handled via reportGeneralTypeIssues rather than reportMissingTypeArgument. The latter is reserved for cases where type arguments are omitted completely.

Enhancement: Improved type narrowing logic for isinstance and issubclass so they better handle the case where the class passed in the second argument is a type variable.

1.1.105

Enhancement: Added missing check for ** used in argument expressions. The expression after the ** must be a mapping with str keys.

Enhancement: Added missing check for a name-only parameter appearing in a signature after a "*args: P.args" ParamSpec parameter.

Enhancement: Improved error message for non-keyword parameter that follows a "*" parameter.

Enhancement: Added missing check for positional argument count when a simple positional argument appears after a *args argument.

Enhancement: Added missing checks for illegal usage of positional parameters when calling a function defined with ParamSpec and Concatenate.

Enhancement: Added missing check for use of keyword arguments in a call to an inner function that uses P.args and P.kwargs defined by a ParamSpec.

Bug Fix: Fixed false positive warning relating to single use of a type variable within a signature when that type variable is a ParamSpec, and it is also referenced in "P.args" or "P.kwargs" annotations.

Enhancement: Added missing PEP 612 support for functions that take a parameter with a callable type that includes a ParamSpec as well as *args: P.args and **kwargs: P.kwargs parameters.

Bug Fix: Fixed false positive error related to use of "ClassVar" when it is used in a member access expression like "typing.ClassVar".

Enhancement: Improved performance for deeply nested expressions that involve calls to overloaded functions.

Bug Fix: Fixed crash when "()" is used as a type argument for a class that doesn't accept variadic type parameters.

1.1.104

Bug Fix: Fixed bug in import resolver where a namespace package was chosen over a traditional package if the former had a shorter name.

Enhancement: Added support for `__call__` method overloads when assigning a callable object to a callable type.

Enhancement: Added error for a subscripted type annotation that involves a quoted expression in the LHS of the subscript. This generates runtime errors.

Enhancement: Enhanced reportIncompatibleMethodOverride diagnostic check to support overrides that have `*args` and `**kwargs` parameters.

Enhancement: Improved completion suggestions to better handle super calls in base class methods.

Bug Fix: Fixed bug that affected the case where a class variable has a declared type in a base class, and a subclass assigns a value to that class variable but doesn't (re)declare its type. In this case, the type of the expression assigned within the base class should use the expected type declared in the base class for type inference.

Enhancement: Added missing error logic to handle the case where a type variable is used in the LHS of a member access expression. This isn't supported currently in the Python type system.

Enhancement: Improved error checking and reporting for NewType (for unions, literals, callables, protocol classes, and type variables).

Enhancement: Added error check for an attempt to instantiate a literal (`Literal[1]()`).

Bug Fix: Fixed bug in TypeVar constraint solving logic. If an "Any" or "Unknown" type is being assigned to a constrained TypeVar, it should result in "Any" or "Unknown" rather than the first constrained type.

Enhancement: Added check for multiple functions declared within the same scope that have the same name, with the final one overwriting the earlier ones. This check is suppressed for overloaded functions and property setters/deleters.

Enhancement: Improved the reportIncompatibleVariableOverride diagnostic check so it ignores symbols with private names (i.e. start with double underscores).

Bug Fix: Changed hover text to use the last declaration of a symbol rather than the first declaration to determine which type category text (e.g. "(module)" or "(class)") in the hover text.

Bug Fix: Fixed bug that caused error when invoking the definition provider on an unresolved module import.

Bug Fix: Fixed bug in logic that infers symbol types that resulted in "unbound" types to be reported incorrectly in certain rare circumstances.

Bug Fix: Fixed a crash in the "--verifytypes" feature of the CLI.

Bug Fix: Fixed bug in file watching logic so it properly handles cases where an entire folder is deleted.

1.1.103

Bug Fix: Suppressed "symbol is unbound" error when used in a `del` statement, since this is legal.

Enhancement: Enhanced --verifytypes command so it can now accept a module path within a package. Type analysis is limited to the specified module and its submodules.

Bug Fix: Fixed bug that caused "--verifytypes" feature to report missing return type annotations for all property getters within a class if only one of them was missing a return type annotation.

Enhancement: Added missing error logic to handle the case where a type variable is subscripted in a type expression. This isn't supported currently in the Python type system.

Enhancement: Improved signature help in case where right parenthesis is missing.

Enhancement: Added error for incorrect use of list expression for type arguments.

1.1.102

Enhancement: Added error for Callable that is missing a return type.

Behavior Change: Changed type analysis behavior when reportGeneralTypeIssues diagnostic rule is disabled and an incompatible type is assigned to a variable. Previously, the assigned type was retained in this case, but now the declared type is assumed (as it is when reportGeneralTypeIssues is enabled).

Enhancement: Added support for completion suggestions within subscript for typed dict attribute names.

Behavior Change: Change string literals to use "constant" type when displayed in completion suggestion lists.

Behavior Change: Changed logic for detecting overrides of Final member variables by subclasses. Symbols with double underscores are now exempt from this check, since they are considered private and are name-mangled.

Bug Fix: Fixed bug in logic that detects overrides of final methods. The logic was not handling the case where a private (single underscore) method was marked final.

Enhancement: Updated typeshed stubs to latest.

Bug Fix: Fixed regression in code that handles context managers that suppress exceptions.

Bug Fix: Fixed bug that resulted in infinite recursion (and an internal error) when NewType was used with a protocol class.

Bug Fix: Fixed reportIncompatibleMethodOverride diagnostic check so it doesn't ignore incompatible protected methods (those whose names start with a single underscore).

Enhancement: Added support for "reveal_locals()" call to reveal all of the symbols within the current scope.

Bug Fix: Fixed internal error resulting from an assignment expression located within a list comprehension scope which is contained within a class scope.

Enhancement: Augmented type completeness JSON output to include alternate public names of exported symbols. For example, if a symbol "foo" is declared in module "a.b.c" and is also re-exported from "a", then the main name of the symbol is "a.b.c.foo", but it has an alternate name of "a.foo".

Enhancement: Improved "partially unknown type" error messages within type completeness report.

Page 49 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.