-
Notifications
You must be signed in to change notification settings - Fork 288
Proposal: Support tuple[T, N] syntax for fixed-length homogeneous tuples #2065
exprator-python
started this conversation in
Polls
-
Currently, typing a fixed-length tuple of the same type in Python requires repeating the type multiple times:
from typing import Tuple
Tuple[int, int, int, int]
This becomes verbose for lengths like 8 or 10.
Proposal
Support syntax:
tuple[int, 8]
Should this be Added to Python?
yes
50%
no
50%
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
This proposal potentially blocks dropping exlicit Literal type. There will be no difference in syntax tuple[int, 8] and tuple[int, Literal[8]]
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
-
Linking #786 for previous discussion
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment