Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pyright from 1.1.373 to 1.1.374 in /.github #417

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 5, 2024

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 <dependency name> 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)

Bumps [pyright](https://github.com/Microsoft/pyright/tree/HEAD/packages/pyright) from 1.1.373 to 1.1.374.
- [Release notes](https://github.com/Microsoft/pyright/releases)
- [Commits](https://github.com/Microsoft/pyright/commits/1.1.374/packages/pyright)

---
updated-dependencies:
- dependency-name: pyright
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Aug 5, 2024
@github-actions github-actions bot enabled auto-merge August 5, 2024 06:38
@github-actions github-actions bot merged commit 610f4e0 into main Aug 5, 2024
5 checks passed
@github-actions github-actions bot deleted the dependabot/npm_and_yarn/dot-github/pyright-1.1.374 branch August 5, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants