FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix crash with type alias to `Callable[[Unpack[Tuple[Any, ...]]], Any]` by AlexWaygood · Pull Request #16541 · python/mypy · GitHub

Repository navigation

Fix crash with type alias to Callable[[Unpack[Tuple[Any, ...]]], Any] - #16541

Merged
JukkaL merged 2 commits into
python:masterfrom
AlexWaygood:fix-tvar-tuple-crash
Dec 12, 2023
Merged

JukkaL merged 2 commits into
python:masterfrom
AlexWaygood:fix-tvar-tuple-crash

Conversation

Copy link
Copy Markdown
Member

Fixes #16533

This comment has been minimized.

Comment thread mypy/expandtype.py Outdated
fallback = var_arg_type.partial_fallback
elif isinstance(var_arg_type, Instance):
# We have something like Unpack[Tuple[Any, ...]]
expanded_items = list(var_arg_type.args)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should we preserve this as an Instance? Are we converting a variable-length tuple to a single-item tuple?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks, I see what you mean (I think)! Does e4d02a4 address this?

I'm surprised no tests failed as a result of this.

github-actions Bot commented Dec 7, 2023

Copy link
Copy Markdown
Contributor

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

JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the fix!

JukkaL merged commit 5fa9569 into python:master Dec 12, 2023
AlexWaygood deleted the fix-tvar-tuple-crash branch December 12, 2023 19:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal error with an alias type that is a callable with an unpacked tuple as args

2 participants


Back | FazBrowse Home | New Git URL