Skip to content

Commit fc5de52

Browse files
committed
Add TODO for typing_extensions.TypeVarTuple with Python 3.10
1 parent 0e0a5e5 commit fc5de52

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
typevar-name-incorrect-variance:11:0:11:21::"Type variable name does not reflect variance. ""GoodNameWithoutContra"" is contravariant, use ""GoodNameWithoutContra_contra"" instead":INFERENCE
2+
typevar-double-variance:19:0:19:1::TypeVar cannot be both covariant and contravariant:INFERENCE
3+
typevar-name-incorrect-variance:19:0:19:1::Type variable name does not reflect variance:INFERENCE
4+
typevar-double-variance:23:0:23:4::TypeVar cannot be both covariant and contravariant:INFERENCE
5+
typevar-name-incorrect-variance:23:0:23:4::Type variable name does not reflect variance:INFERENCE
6+
typevar-double-variance:24:0:24:8::TypeVar cannot be both covariant and contravariant:INFERENCE
7+
typevar-name-incorrect-variance:24:0:24:8::Type variable name does not reflect variance:INFERENCE
8+
invalid-name:37:0:37:10::"Type variable name ""CALLABLE_T"" doesn't conform to predefined naming style":HIGH
9+
invalid-name:38:0:38:10::"Type variable name ""DeviceType"" doesn't conform to predefined naming style":HIGH
10+
invalid-name:39:0:39:10::"Type variable name ""IPAddressU"" doesn't conform to predefined naming style":HIGH
11+
invalid-name:42:0:42:7::"Type variable name ""TAnyStr"" doesn't conform to predefined naming style":HIGH
12+
invalid-name:45:0:45:7::"Type variable name ""badName"" doesn't conform to predefined naming style":HIGH
13+
invalid-name:46:0:46:10::"Type variable name ""badName_co"" doesn't conform to predefined naming style":HIGH
14+
invalid-name:47:0:47:14::"Type variable name ""badName_contra"" doesn't conform to predefined naming style":HIGH
15+
invalid-name:51:4:51:13::"Type variable name ""a_BadName"" doesn't conform to predefined naming style":HIGH
16+
invalid-name:52:4:52:26::"Type variable name ""a_BadNameWithoutContra"" doesn't conform to predefined naming style":HIGH
17+
typevar-name-incorrect-variance:52:4:52:26::"Type variable name does not reflect variance. ""a_BadNameWithoutContra"" is contravariant, use ""a_BadNameWithoutContra_contra"" instead":INFERENCE
18+
invalid-name:54:13:54:29::"Type variable name ""a_BadName_contra"" doesn't conform to predefined naming style":HIGH
19+
invalid-name:63:0:63:7::"Type variable name ""badName"" doesn't conform to predefined naming style":HIGH
20+
typevar-double-variance:64:0:64:4::TypeVar cannot be both covariant and contravariant:INFERENCE
21+
typevar-name-incorrect-variance:64:0:64:4::Type variable name does not reflect variance:INFERENCE
22+
invalid-name:71:0:71:7::"Parameter specification variable name ""badName"" doesn't conform to predefined naming style":HIGH
23+
invalid-name:77:0:77:7::"Parameter specification variable name ""badName"" doesn't conform to predefined naming style":HIGH
24+
invalid-name:91:0:91:7::"Type variable tuple name ""badName"" doesn't conform to predefined naming style":HIGH

tests/functional/t/type/typevar_naming_style_default.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
# badName = TypeVarTuple("badName") # invalid-name
8585

8686
# -- typing_extensions.TypeVarTuple (3.11+) --
87+
# TODO Can't infer typing_extensions.TypeVarTuple for 3.10 # pylint:disable=fixme
8788
Ts = te.TypeVarTuple("Ts")
8889
_Ts = te.TypeVarTuple("_Ts")
8990
GoodNameTs = te.TypeVarTuple("GoodNameTs")
90-
badName = te.TypeVarTuple("badName") # [invalid-name]
91+
badName = te.TypeVarTuple("badName") # >=3.11:[invalid-name]

tests/functional/t/type/typevar_naming_style_default.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ typevar-double-variance:64:0:64:4::TypeVar cannot be both covariant and contrava
2121
typevar-name-incorrect-variance:64:0:64:4::Type variable name does not reflect variance:INFERENCE
2222
invalid-name:71:0:71:7::"Parameter specification variable name ""badName"" doesn't conform to predefined naming style":HIGH
2323
invalid-name:77:0:77:7::"Parameter specification variable name ""badName"" doesn't conform to predefined naming style":HIGH
24-
invalid-name:90:0:90:7::"Type variable tuple name ""badName"" doesn't conform to predefined naming style":HIGH
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
invalid-name:13:0:13:9::"Type variable name ""GoodNameT"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
2+
invalid-name:14:0:14:12::"Type variable name ""GoodNameT_co"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
3+
invalid-name:15:0:15:16::"Type variable name ""GoodNameT_contra"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
4+
invalid-name:20:0:20:9::"Type variable name ""GoodNameT"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
5+
invalid-name:21:0:21:12::"Type variable name ""GoodNameT_co"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
6+
invalid-name:26:0:26:9::"Parameter specification variable name ""GoodNameP"" doesn't conform to 'ParamSpecShouldBeLikeThis$' pattern":HIGH
7+
invalid-name:30:0:30:9::"Parameter specification variable name ""GoodNameP"" doesn't conform to 'ParamSpecShouldBeLikeThis$' pattern":HIGH
8+
invalid-name:40:0:40:10::"Type variable tuple name ""GoodNameTs"" doesn't conform to 'TypeVarTupleShouldBeLikeThis$' pattern":HIGH

tests/functional/t/type/typevar_naming_style_rgx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
# GoodNameTs = TypeVarTuple("GoodNameTs") # invalid-name
3636

3737
# -- typing_extensions.TypeVarTuple --
38+
# TODO Can't infer typing_extensions.TypeVarTuple for 3.10 # pylint:disable=fixme
3839
TypeVarTupleShouldBeLikeThis = te.TypeVarTuple("TypeVarTupleShouldBeLikeThis")
39-
GoodNameTs = te.TypeVarTuple("GoodNameTs") # [invalid-name]
40+
GoodNameTs = te.TypeVarTuple("GoodNameTs") # >=3.11:[invalid-name]

tests/functional/t/type/typevar_naming_style_rgx.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ invalid-name:20:0:20:9::"Type variable name ""GoodNameT"" doesn't conform to 'Ty
55
invalid-name:21:0:21:12::"Type variable name ""GoodNameT_co"" doesn't conform to 'TypeVarsShouldBeLikeThis(_co(ntra)?)?$' pattern":HIGH
66
invalid-name:26:0:26:9::"Parameter specification variable name ""GoodNameP"" doesn't conform to 'ParamSpecShouldBeLikeThis$' pattern":HIGH
77
invalid-name:30:0:30:9::"Parameter specification variable name ""GoodNameP"" doesn't conform to 'ParamSpecShouldBeLikeThis$' pattern":HIGH
8-
invalid-name:39:0:39:10::"Type variable tuple name ""GoodNameTs"" doesn't conform to 'TypeVarTupleShouldBeLikeThis$' pattern":HIGH

0 commit comments

Comments
 (0)