Skip to content
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

Fix type aliases with fixed-length tuples #14184

Merged
merged 7 commits into from
Nov 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test cases
  • Loading branch information
JukkaL committed Nov 25, 2022
commit 68719a5e3a839dd003236c01333f751a220d96c3
7 changes: 7 additions & 0 deletions test-data/unit/check-type-aliases.test
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,10 @@ y_bad: B[str] # E: Type argument "str" of "B" must be a subtype of "int"
# flags: --python-version 3.8
NotYet1 = tuple[float] # E: "tuple" is not subscriptable
NotYet2 = tuple[float, float] # E: "tuple" is not subscriptable
NotYet3 = tuple[float, ...] # E: Unexpected "..." \
# E: "tuple" is not subscriptable
NotYet4 = tuple[float, float, ...] # E: Unexpected "..." \
# E: "tuple" is not subscriptable
[builtins fixtures/tuple.pyi]

[case testTupleWithDifferentArgsStub]
Expand All @@ -1008,6 +1012,9 @@ import tup
Correct1 = str | tuple[float, float, str]
Correct2 = tuple[float] | str
Correct3 = tuple[float, ...] | str
Correct4 = tuple[float, str] | str
Correct5 = tuple[int, str]
Correct6 = tuple[int, ...]

RHSAlias1: type = tuple[int, int]
RHSAlias2: type = tuple[int]
Expand Down