-
Notifications
You must be signed in to change notification settings - Fork 252
Question about Tuple with ellipsis #180
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
PP 484 is clear on the matter; only one type is allowed (and required) t appear before the ellipsis:
|
@AlfreG Your question is probably better suited for our discussion forum: https://github.com/python/typing/discussions |
@srittau I love that you dug this ticket out after 5 years for that comment. Careful, even if it reads like that, the non-working |
I have no idea what happened here. My answer was clearly not meant for this issue, but I'm not sure which issue it was meant for. |
FWIW, if PEP 646 is accepted, it will enable tuple types like this to be expressed as follows:
(or if the nicer syntax for Mypy doesn't yet contain support for PEP 646, but if you're interested in playing around with it, pyright and pyre both implement the latest draft of the PEP. |
The nicer syntax was approved but will only be in Python 3.11. We'll backport Unpack support to older versions in typing-extensions. |
That's great news about the nicer syntax being approved. Do you recall where you saw that? I'm interested in the details. I presume that the more general syntax change proposed in PEP 637 was not accepted. |
Does
Tuple
support form ofTuple[int, str, ...]
with more than one parameter before the ellipsis? It seems that it's not, currently.I guess, Ellipsis-related check has to be implemented somehow like this:
The text was updated successfully, but these errors were encountered: