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

@AlexWaygood

@AlexWaygood

@github-actions

This comment has been minimized.

JukkaL

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.

@AlexWaygood

@github-actions

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

JukkaL

Choose a reason for hiding this comment

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

Thanks for the fix!