Skip to content

Multiple types for variable-length Tuples #8126

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

Closed
rggjan opened this issue Dec 10, 2019 · 2 comments
Closed

Multiple types for variable-length Tuples #8126

rggjan opened this issue Dec 10, 2019 · 2 comments

Comments

@rggjan
Copy link

rggjan commented Dec 10, 2019

After #184 is supported, it would be great if variable-length Tuples would also work with multiple types.

For example, a Tuple with a string and zero or more ints inside could look like this:

Tuple[str, int, ...]

which currently can only be expressed as:

Tuple[Any, ...]

@msullivan
Copy link
Collaborator

While that could be useful in some cases, I think it's unlikely we're going to support that. In any case, a change to Tuple is a pretty fundamental change to the typing module, so I think it would need to be proposed at https://github.com/python/typing/ and would require a change to the PEP (or a new PEP?).

@rggjan
Copy link
Author

rggjan commented Dec 12, 2019

👍

See python/typing#692

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

No branches or pull requests

2 participants