Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix walrus assignment type propagation across call arguments#20427

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Vaishnavi-KN wants to merge5 commits intopython:master
base:master
Choose a base branch
Loading
fromVaishnavi-KN:fix-walrus-call-args

Conversation

@Vaishnavi-KN
Copy link

Mypy failed to infer the type of a variable assigned via the walrus operator
when the assignment appeared in an earlier keyword argument and the variable
was used in a later argument in the same call.

This PR evaluates call arguments once, left to right, so binder updates from
walrus assignments are preserved.

Fixes#20411

@github-actions

This comment has been minimized.

Copy link
Collaborator

@A5rocksA5rocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For the test case, please:

  • follow test name conventions
  • use the inline comments for output

I also recommend using my repro as a test case, maybe separately.

(For some reason I'm unable to make an inline comment...)

@Vaishnavi-KN
Copy link
Author

I have updated the test to follow naming conventions and inline output comments as suggested.
The remaining workflows appear to be awaiting maintainer approval.

@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja left review comments

+1 more reviewer

@A5rocksA5rocksA5rocks left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot determine type of walrus operator variable in list comprehension

3 participants

@Vaishnavi-KN@hauntsaninja@A5rocks

[8]ページ先頭

©2009-2025 Movatter.jp