sublimelsp / LSP-pyright

Python support for Sublime's LSP plugin provided through microsoft/pyright.
MIT License
126 stars 13 forks source link

chore(deps): bump pyright from 1.1.373 to 1.1.374 in /language-server #346

Closed dependabot[bot] closed 1 month ago

dependabot[bot] commented 1 month ago

Bumps pyright from 1.1.373 to 1.1.374.

Release notes

Sourced from pyright's releases.

Published 1.1.374

Note: This week's release includes some major changes related to TypeVar constraint solving that have been in the works for a while. These changes simplify the code, make constraint solving behaviors more consistent, and eliminate a number of false positive errors that were reported over the past year. However, these code changes produce different constraint solving behaviors in some cases. These extensive code changes also come with the potential of regressions. I've done extensive analysis of the type checking outputs across over a hundred public code bases, but it's possible that I've missed something. Please report any new behavior that you think is a bug.

Bug Fixes:

  • Fixed bug in logic that validates subtyping relationships between TypeIs[T], TypeGuard[T] and bool when used in a return type of a callable.
  • Fixed bug that results in a crash if Optional is used with no subscript (i.e. Optional[]).
  • Fixed bug in isinstance type narrowing if the second argument is object and the first argument is a type instance.
  • Fixed a bug that results in a crash in certain conditions involving a corrupt builtins.pyi stub.
  • Fixed recent regression that results in incorrect isinstance type narrowing when the filter class and the type are both protocols.
  • Fixed bug that results in a warning if the self parameter in an __init__ method is given an explicit Self annotation.
  • Fixed recent regression that results in a false positive error when evaluating certain nested constructor calls when used with bidirectional type inference.
  • Fixed false positive error when iterator returns a class object from its __iter__ method.
  • Fixed recent regression that results in a false positive error under certain circumstances when yield expression includes a call to a constructor.
  • Fixed a bug that results in an incorrect "inconsistent overload" error when the overloads return TypeIs or TypeGuard and the implementation returns bool.
  • Fixed a bug that results in incorrect type narrowing when tuples are used in conjunction with TypeIs.
  • Fixed a bug that can result in incorrect type evaluation when an isinstance type narrowing results in an intersection type.
  • Fixed bug that results in a false negative if a __set__ descriptor method is marked deprecated and is implicitly accessed using an augmented assignment operator, as in a.x += 1.
  • Fixed bug that can result in a false negative when a function return type is a TypeVar and the function falls through and implicitly returns a None.
  • Fixed bug that can result in a false positive when calling the constructor within a class that has unannotated __init__ or __new__ method parameters.
  • Fixed bug that results in false positive error under certain circumstances when solving type variables that involve literal values.
  • Fixed bug that results in a false positive when using a two-argument form of super() outside of a class.

Enhancements:

  • Improved signature help for constructor calls. Replaced old heuristics that displayed either the __init__ or __new__ signature with a mechanism that uses the recently-ratified typing spec algorithm for converting a constructor into a callable. This is prompted in part by this discussion.
  • Added error check for an enum attribute with a "naked" Final attribute. This should be considered invalid.
  • Added a new configuration option enableReachabilityAnalysis. It is off by default when typeCheckingMode is "off" but otherwise on by default. When disabled, it causes pyright not to identify code blocks that are determined to be unreachable via type analysis. Code blocks that are determined to be unreachable via non-type information are still displayed as such.
  • Enhanced type narrowing for sequence patterns to support tuple expansion when the subject is a tuple whose entries are union types.
  • Added missing check for Final variable assigned in a loop.
  • Added support for @deprecated decorator on magic methods for unary and binary operations.
  • Added support for @deprecated on __bool__ magic method used by not operator.
  • Added support for @deprecated on __new__ methods used implicitly during a class constructor call.

Other Changes:

  • Changed evaluation behavior for TypeVar bounds, constraints, and defaults to enforce type expression evaluation rules, consistent with the typing spec.
  • Eliminated error condition when using a subscript expression for a generic class that does not conform to type expression rules (e.g. list[1 + 2]) if the expression is a value expression.
  • Modified heuristics in T is None type narrowing logic to handle TypeVars with no bounds better. The previous logic was arguably correct, but it produced results that were unexpected by some users.
  • Adjusted the heuristics for constraint solving to favor solutions of type T over type[T]` when both are valid.
Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
github-actions[bot] commented 1 month ago

Following are the schema changes in the new version. Make sure that those are reflected in LSP-pyright.sublime-settings and sublime-package.json files.

sublime-package.json schema updated.

New keys found in the latest pyrightconfig.json schema: 
 - enableReachabilityAnalysis

Ensure that those are added to the sublime-package.json manually, if relevant.