Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proposal: Support tuple[T, N] syntax for fixed-length homogeneous tuples #2065

exprator-python started this conversation in Polls
Discussion options

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

You must be logged in to vote

Replies: 2 comments

Comment options

This proposal potentially blocks dropping exlicit Literal type. There will be no difference in syntax tuple[int, 8] and tuple[int, Literal[8]]

You must be logged in to vote
0 replies
Comment options

Linking #786 for previous discussion

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /