Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 35 of 81

1.1.192

Enhancement: Sped up "find reference" by performing a quick text search for the reference symbol and avoiding additional work for that file if there is no chance of finding a reference within it.

Bug Fix: Fixed misleading error message involving a type mismatch within the TypeVar constraint solver. The source and destination types were reversed.

Bug Fix: Fixed a bug in ternary expression type evaluation that resulted in a false positive error. It was not properly handling the case where the condition was statically determined to be false or true.

Enhancement: Improved error message for unknown or partially-unknown type arguments in package type verifier.

Bug Fix: Added missing check in package type verifier for generic type aliases with missing type arguments.

Bug Fix: Fixed bug that resulted in false positive error when a `__new__` method has its own type variables that are not scoped to its corresponding class.

Bug Fix: Changed behavior of symbol resolution involving a quoted (forward-declared) type annotation that references a symbol in the global (module) or builtins namespaces. The previous implementation didn't match the runtime behavior of `typing.get_type_hints`.

Bug Fix: Improved heuristics that are intended to choose the simplest type when more than one solution is possible for a set of type variables.

Enhancement: Added support for class-based definition of "NewType", which will appear in a new version of typeshed stubs soon.

Bug Fix: Added missing check in function type compatibility checks for the case where the source type contains position-only parameters but the destination type does not.

Bug Fix: Added support for synthesized `__hash__` method for dataclass and dataclass_transform.

Bug Fix: Fixed bug that resulted in false positive parse error when using "/" parameter in type stub when pythonVersion was prior to Python 3.8.

1.1.191

Bug Fix: Fixed bug in synthesized `__match_args__` type for dataclass, which shouldn't include any keyword-only fields. Thanks to HKGx for this contribution.

Bug Fix: Added special-casing to suppress "partially unknown type" diagnostic within member access expressions when they are used to access non-specialized generic classes within an argument expression. There are legitimate uses of partially unknown types in this case (e.g. in "isinstance" calls).

Behavior Change: Exempted class symbol `__weakref__` from type completeness check since its type is well defined by the Python spec.

Behavior Change: Changed reportPropertyTypeMismatch to be disabled by default in all diagnostic modes.

Bug Fix: Fixed a hole in the check for partially-unknown types. Generic type aliases that are not specialized or are partially specialized (i.e. only some type arguments are specified) should trigger this check.

Bug Fix: Fixed bug that resulted in a false positive error when using class pattern matching with type variables.

Bug Fix: Fixed bug in "--ignoreexternal" mode of "--verifytypes" feature. It was not properly flagging errors when the type was external (and known) but the type arguments were partially unknown.

Enhancement: Enhanced truthy/falsy type narrowing pattern to handle classes that contain a `__bool__` method that always returns True or False.

Enhancement: Changed parse error messages related to unclosed parentheses, braces and brackets so they are reported at the location of the starting token to better match the new Python 3.10 parse error reporting behavior.

1.1.190

Bug Fix: Fixed bug that caused false positive when evaluating type compatibility between two TypedDict types that are structurally the same but have different declarations. PEP 589 indicates that these should be treated as compatible types.

Bug Fix: In the case where a type annotation is an illegal form (e.g. a variable or a function), the annotation should evaluate to an Unknown type.

Enhancement: Added support for async functions that return `NoReturn` type.

Bug Fix: Fixed bug that prevented error when a generator function returned an inappropriate type if that type was a subclass of `Iterable`.

Bug Fix: Fixed bug that resulted in unreported Unknown type in strict mode when the type was evaluated as part of a call to an overloaded function in some circumstances.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Improved check for inconsistent use of tabs and spaces to catch a previously-unreported case that generates runtime errors.

Bug Fix: Added a type consistency check for TypedDicts which are otherwise compatible except that one is marked final and the other is not.

Behavior Change: Changed reportUnusedVariable diagnostic check to exempt variables whose names begin with an underscore.

Behavior Change: Changed logic that determines whether a function should be exempt from return type consistency checks. If a function or method contains only a docstring but no `...`, it is no longer exempt (unless it is an `overload`).

1.1.189

Bug Fix: Fixed regression relating to type inference for non-generic classes that have unannotated constructors (so-called "pseudo-generic classes").

Bug Fix: Fixed crash that occurred when specializing a class with a TypeVarTuple and failing to provide a type argument for the TypeVarTuple type parameter.

Bug Fix: Fixed recent regression in import resolver that caused a local import to no longer be preferred over an installed module by the same name.

Bug Fix: Fixed bug that caused incorrect type evaluation of parameter with implied Optional type based on `None` default argument value when `strictParameterNoneValue` setting is false.

Enhancement: Added checks for illegal forms of `Literal` type arguments.

Bug Fix: Fixed false positive error when using a union type expression in an `isinstance` or `issubclass` call on Python 3.10.

Bug Fix: Fixed bug in code flow engine that caused incorrect determination of node reachability in cases where an unannotated function recursively called itself.

Bug Fix: Fixed a hole in the type checking logic for TypedDict classes. It was not properly handling the invariant case.

Behavior Change: Made illegal assignment target checks unconditional so they are not gated by reportGeneralTypeIssues. These should be treated more like parse errors than type checking errors.

1.1.188

Bug Fix: Fixed issue that caused import resolution failures for certain submodules of `google.cloud`.

Bug Fix: Fixed crash in completion provider.

Bug Fix: Fixed bug in ParamSpec type evaluation that caused a false positive error when assigning a callable with a `Concatenate` to another `ParamSpec`.

Bug Fix: Fixed bug in ParamSpec logic that resulted in false positive when a TypeVar was used as within a Concatenate expression.

Bug Fix: Fixed bug in type evaluator that resulted in false positive error in strict mode. Type of call argument expression was incorrectly reported as partially unknown in some cases.

Bug Fix: Fixed bug that resulted in a false positive when a tuple with known element types is used as an unpacked argument in a call to a function that uses position-only parameters.

Bug Fix: Fixed type checking hole (false negative) in certain circumstances involving loop constructs and variables whose types are modified within these loops. This bug fix also has a positive performance impact when analyzing functions with complex code flow graphs.

Bug Fix: Fixed issue that caused CLI version of pyright to use incorrect Python interpreter to discover the Python version when no "pythonVersion" configuration setting was supplied.

Enhancement: Implemented diagnostic check for a `ClassVar` declaration that uses a type variable. PEP 526 explicitly states that this is not allowed.

1.1.187

Bug Fix: Fixed false positive error when assigning type `T | Any` to type `T`.

Behavior Change: Changed `Callable` special form to include a position-only marker at the end of the parameter list. Changed type printer to omit the `/` if it is unnecessary.

Behavior Change: Modified the check for function declaration redefinitions to allow for same-signature overrides in cases where the declarations are not within the same statement suite (e.g. one in the "if" and the other in the "else" block).

Bug Fix: Fixed missing diagnostic when a Self parameter was assigned to a `Concatenate[X, P]` where `X` is a type that is incompatible with `Self`.

Bug Fix: Fixed bug that resulted in a false positive error when a specialized generic class with a `__call__` method uses a ParamSpec and is assigned to a `Callable` that is also parameterized with a ParamSpec.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug that resulted in hover text for symbols used within a default argument expression to sometimes be displayed as "Unknown".

Bug Fix: Fixed regression in handling of callback protocols that define a `__name__` attribute, which is common to all functions.

Behavior Change: Added support for upcoming change in typing.pyi in the way that the `NoReturn` symbol is declared.

Page 35 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.