You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support user defined variadic tuple types (#15961)
Fixes#15946
Note this actually adds support also for variadic NamedTuples and
variadic TypedDicts. Not that anyone requested this, but since generic
NamedTuples and generic TypedDicts are supported using the same
mechanism (special aliases) as generic tuple types (like `class
A(Tuple[T, S]): ...` in the issue), it looked more risky and arbitrary
to _not_support them.
Btw the implementation is simple, but while I was working on this, I
accidentally found a problem with my general idea of doing certain type
normlaizations in `semanal_typeargs.py`. The problem is that sometimes
we can call `get_proper_type()` during semantic analysis, so all the
code that gets triggered by this (mostly `expand_type()`) can't really
rely on types being normalized. Fortunately, with just few tweaks I
manged to make the code mostly robust to such scenarios (TBH there are
few possible holes left, but this is getting really complex, I think it
is better to release this, and see if people will ever hit such
scenarios, then fix accordingly).
0 commit comments