Pyright

Latest version: v1.1.390

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

Scan your dependencies

Page 28 of 81

1.1.232

Enhancement: Improved diagnostic messages for overload implementation mismatch.

Bug Fix: Fixed bug that resulted in false negative when assigning one function to another and the dest contains named positional arguments that have no corresponding positional slot in the dest and the dest does not contain a **kwargs.

Bug Fix: Modified the special-case logic for `property` so it exposes methods and attributes provided by `object`.

Bug Fix: Improved the `reportIncompatibleMethodOverride` check to report a diagnostic if the base method provides a default argument value for a parameter but the override does not.

Behavior Change: Lowered cyclical code complexity threshold for code flow analysis in an attempt to reduce stack overflow crashes.

Bug Fix: Fixed a false positive error relating to `__slots__` when using a descriptor object that was assigned to a class variable in a base class.

Enhancement: Updated typeshed stubs to the latest version.

Enhancement: Added support for new `assert_type` call, which is being added to Python 3.11 and typing_extensions.

Bug Fix: Fixed false positive error that occurs when assigning a class variable with a type annotation an expression that involves the name of the class variable symbol.

Bug Fix: Improved modeling of property class so its `fget`, `fset`, `fdel`, `__get__`, `__set__` and `__delete__` methods are updated properly when adding a setter or deleter.

Bug Fix: Fixed bug that resulted in false positive when overriding a method with position-only parameters when the base uses the old-style mechanism and the override uses the new-style `/` separator or vice versa.

1.1.231

Behavior Change: Moved a couple of type-related diagnostics under the reportGeneralTypeIssues diagnostic rule rather than reporting them unconditionally.

Bug Fix: Fixed false negative for the reportIncompatibleMethodOverride diagnostic check. It was not detecting the case where the base method used keyword parameters but the override method used position-only parameters.

Bug Fix: Fixed bug that resulted in a false positive error when matching a module against a specialized generic protocol class.

Bug Fix: Fixed a bug that resulted in misleading output when printing the type of a generic alias that includes a generic function parameterized by a ParamSpec and is later specialized.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when a generic type alias parameterized with a ParamSpec was specialized multiple times.

Bug Fix: Fixed bug in "--verifytypes" feature. It was ignoring a missing parameter annotation for the first parameter in a non-method function.

Bug Fix: Fixed a bug that resulted in a false positive error when a generic callback protocol was passed as an argument to another generic callback protocol.

1.1.230

Bug Fix: Fixed a bug that resulted in a false positive "reportMissingParameterType" error when using an old-style double underscore parameter name to indicate position-only parameter.

Bug Fix: Handled the special case where an `Any` expression is bound to a ParamSpec giving it default parameters.

Bug Fix: Fixed bug that resulted in a false positive error when using a dictionary unpack operator `**` with an instance of a class that satisfied the `SupportsKeysAndGetItem` protocol but did not directly derive from `Mapping`.

Enhancement: Added new diagnostic check `reportUnusedExpression` to catch bugs like `a == 4` when `a = 4` was intended.

Enhancement: Added special-case logic for a Type[T] (where T is an unbound TypeVar) that is instantiated through a call to its constructor. It should evaluate to T rather than Any.

Bug Fix: Fixed bug in pattern exhaustive match logic that failed to detect exhaustive match when the subject expression was a unnarrowable expression form.

Bug Fix: Improved the heuristics in the alias resolution logic to prefer declarations that are in non-exception paths even if the exception path has a typed decl and the non-exception decl must be inferred.

Bug Fix: Fixed two bugs that generated false positive errors when using PEP 604 union syntax in an implicit type alias. The first bug affected the case where the union started with `None`. The second affected the case where a TypeVar was included in the union.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug that resulted in false positive reportIncompatibleVariableOverride error when one base class defined a symbol as a property and another base class defined a symbol as Any.

Enhancement: Added support for the use of `Concatenate` as a type argument for a generic type alias that accepts a ParamSpec.

1.1.229

Bug Fix: Fixed a bug that caused semantic highlighting to sometimes skip information for certain tokens involved in member access expressions.

Enhancement: Added checks for incompatible variable types for same-named instance or class variables in two base classes.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed a bug that led to misleading type error messages and hover text when a type with an associated generic type alias was specialized. The underlying generic type was properly specialized, but the type alias itself appeared to be unspecialized still. Since the type alias is displayed in error messages and hover text, this was confusing.

Bug Fix: Fixed a bug where classes that derive from `Any` are not allowed to be assigned to a TypeVar. This resulted in a false positive error when returning `NotImplemented` in a function that is annotated to return a TypeVar.

Bug Fix: Fixed a bug that resulted in a false positive error "variable not in slots" when a value was assigned to a class variable that is a descriptor.

Bug Fix: Fixed a bug in the `__post_init__` validation logic that resulted in a false positive when a dataclass with an `InitVar` derives from another dataclass with an `InitVar`.

Enhancement: Added support for per-line suppression of diagnostics using ` pyright: ignore` comment. This also supports rule-specific suppression using a list of diagnostic rules, as in ` pyright: ignore [reportGeneralTypeIssues]`.

Bug Fix: Fixed a bug in the reportUnnecessaryComparison diagnostic rule that resulted in false negatives when one of the two operands included a `None` in the type.

Bug Fix: Fixed a bug that resulted in a false positive error when testing type compatibility of an invariant type argument that consists of a union of types, some of which are subtypes of each other.

1.1.228

Bug Fix: Improved "reportUnnecessaryComparison" diagnostic check so it catches more cases.

Performance: Fixed performance bug that was causing a significant slowdown when evaluating highly nested call expressions especially when there are argument errors in the innermost expressions.

Enhancement: Extended support for narrowing of index expressions to include those with negative subscripts, such as `a[-1]`. This is supported for all supported type guard patterns.

Bug Fix: Fixed bug that resulted in a false positive error when using `typing.Self` in an inner function defined within an outer method.

Enhancement: Added negative type narrowing support for sequence patterns in match statements.

Bug Fix: Fixed a bug in negative type narrowing for class patterns in match statements when the class in the class pattern is one of the designated "special built-in classes" specified in PEP 634 and a class argument is specified.

Bug Fix: Fixed a bug that resulted in incorrect TypeVar resolution when the TypeVar was used in a `Type[T]` type expression, was constrained, and two of the constraints overlapped in type.

Bug Fix: Fixed an edge case in the code flow engine that theoretically could result in incorrect type evaluation.

Bug Fix: Fixed a bug in the code flow engine that resulted in inconsistent type evaluation depending on order of evaluation in some cases where a variable is modified in a loop.

Bug Fix: Fixed bug that resulted in a stack overflow when evaluating unions with large numbers of subtypes.

1.1.227

Enhancement: Extended conditional types to function and constructor calls where one or more arguments is a conditional type.

Bug Fix: Fixed a bug that resulted in incorrect type inference when assigning `()` to a variable with an explicit type declaration of `tuple[()]`.

Bug Fix: Fixed bug that results in incorrect type evaluation when an `if` statement is not paired with an `else` and the condition expression uses a `not` paired with an `and` or `or`.

Bug Fix: Fixed bug that caused a class that derives from `NamedTuple` to not conform to the `Hashable` protocol.

Behavior Change: Changed override detection to always use an overload implementation if present.

Behavior Change: Fixed bug that caused symbols in unreachable code to be ignored in "Rename Symbol" and "Find all References" operations.

Bug Fix: Fixed bug that resulted in a false positive when `cls` was used as an argument to a dynamic `type` creation call.

Enhancement: Improved error message for overload that doesn't match its implementation.

Bug Fix: Added code to avoid an attempt to analyze a function if its code flow complexity is too high. This reduces the likelihood of a stack overflow within the type evaluator. If a function or module is too complex, a diagnostic is now emitted to tell the developer that full analysis is suspended for that execution scope.

Bug Fix: Improved reportIncompatibleMethodOverride diagnostic check, including fixes for a few false positives and false negatives and improvements to diagnostic messages.

Page 28 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.