Fix crash with type alias to `Callable[[Unpack[Tuple[Any, ...]]], Any]` by AlexWaygood · Pull Request #16541 · python/mypy
| 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) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we preserve this as an Instance? Are we converting a variable-length tuple to a single-item tuple?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I see what you mean (I think)! Does e4d02a4 address this?
I'm surprised no tests failed as a result of this.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
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