Skip to content

Commit ab074f6

Browse files
authored
Updated conformance test results for mypy 1.11.0 and pyright 1.1.372 (#1812)
Updated conformance test results for mypy 1.11.0 and pyright 1.1.372. This version of mypy adds experimental support for some PEP 695 features, which turned many "Unsupported" tests to either "Partial" or "Pass". It also includes fixes for a few enum and namedtuple conformance issues. There were no conformance changes for pyright, just a few tweaks to error messages.
1 parent cef5d6d commit ab074f6

33 files changed

+173
-432
lines changed

conformance/results/mypy/aliases_explicit.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ aliases_explicit.py:67: error: Bad number of arguments for type alias, expected
77
aliases_explicit.py:68: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg]
88
aliases_explicit.py:69: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg]
99
aliases_explicit.py:70: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg]
10-
aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc]
10+
aliases_explicit.py:71: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [valid-type]
1111
aliases_explicit.py:79: error: Invalid type alias: expression is not a valid type [valid-type]
1212
aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type]
1313
aliases_explicit.py:81: error: Invalid type alias: expression is not a valid type [valid-type]
@@ -23,13 +23,11 @@ aliases_explicit.py:89: error: Invalid type: try using Literal[1] instead? [val
2323
aliases_explicit.py:90: error: Invalid type alias: expression is not a valid type [valid-type]
2424
aliases_explicit.py:90: error: Function "list" could always be true in boolean context [truthy-function]
2525
aliases_explicit.py:91: error: Invalid type alias: expression is not a valid type [valid-type]
26-
aliases_explicit.py:101: error: "<typing special form>" not callable [operator]
26+
aliases_explicit.py:101: error: "UnionType[list[Any], set[Any]]" not callable [operator]
2727
aliases_explicit.py:102: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg]
2828
"""
2929
conformance_automated = "Fail"
3030
errors_diff = """
3131
Line 100: Expected 1 errors
3232
"""
33-
ignore_errors = [
34-
'Function "list" could always be true in boolean context',
35-
]
33+
ignore_errors = ["Function \"list\" could always be true in boolean context"]

conformance/results/mypy/aliases_implicit.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ aliases_implicit.py:76: error: Bad number of arguments for type alias, expected
44
aliases_implicit.py:77: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg]
55
aliases_implicit.py:78: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg]
66
aliases_implicit.py:79: error: Bad number of arguments for type alias, expected 1, given 2 [type-arg]
7-
aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc]
7+
aliases_implicit.py:80: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [valid-type]
88
aliases_implicit.py:81: error: Type argument "str" of "GoodTypeAlias12" must be a subtype of "float" [type-var]
99
aliases_implicit.py:100: error: Function "list" could always be true in boolean context [truthy-function]
1010
aliases_implicit.py:106: error: Variable "aliases_implicit.BadTypeAlias1" is not valid as a type [valid-type]
@@ -35,7 +35,7 @@ aliases_implicit.py:118: error: Variable "aliases_implicit.BadTypeAlias13" is no
3535
aliases_implicit.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
3636
aliases_implicit.py:119: error: Variable "aliases_implicit.BadTypeAlias14" is not valid as a type [valid-type]
3737
aliases_implicit.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
38-
aliases_implicit.py:133: error: "<typing special form>" not callable [operator]
38+
aliases_implicit.py:133: error: "UnionType[list[Any], set[Any]]" not callable [operator]
3939
aliases_implicit.py:135: error: Bad number of arguments for type alias, expected 0, given 1 [type-arg]
4040
"""
4141
conformance_automated = "Pass"
Lines changed: 37 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,46 @@
1-
conformant = "Unsupported"
1+
conformant = "Partial"
22
notes = """
3-
Does not support `type` statement.
3+
Does not reject use of TypeAliasType as base class.
4+
Does not reject redefinition of type alias defined with type statement.
5+
Does not reject type alias defined in function scope.
6+
Does not reject type alias with circular definition.
47
"""
58
output = """
6-
aliases_type_statement.py: error: Cannot assign multiple types to name "BadTypeAlias14" without an explicit "Type[...]" annotation [misc]
7-
aliases_type_statement.py:8: error: PEP 695 type aliases are not yet supported [valid-type]
8-
aliases_type_statement.py:9: error: PEP 695 type aliases are not yet supported [valid-type]
9-
aliases_type_statement.py:9: error: Name "S3" is not defined [name-defined]
10-
aliases_type_statement.py:9: error: Name "S1" is not defined [name-defined]
11-
aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined]
12-
aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type]
13-
aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index]
14-
aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type]
15-
aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined]
16-
aliases_type_statement.py:23: error: "type[int]" has no attribute "other_attrib" [attr-defined]
17-
aliases_type_statement.py:37: error: PEP 695 type aliases are not yet supported [valid-type]
18-
aliases_type_statement.py:38: error: PEP 695 type aliases are not yet supported [valid-type]
19-
aliases_type_statement.py:39: error: PEP 695 type aliases are not yet supported [valid-type]
20-
aliases_type_statement.py:40: error: PEP 695 type aliases are not yet supported [valid-type]
21-
aliases_type_statement.py:41: error: PEP 695 type aliases are not yet supported [valid-type]
22-
aliases_type_statement.py:42: error: PEP 695 type aliases are not yet supported [valid-type]
23-
aliases_type_statement.py:43: error: PEP 695 type aliases are not yet supported [valid-type]
24-
aliases_type_statement.py:44: error: PEP 695 type aliases are not yet supported [valid-type]
25-
aliases_type_statement.py:45: error: PEP 695 type aliases are not yet supported [valid-type]
26-
aliases_type_statement.py:46: error: PEP 695 type aliases are not yet supported [valid-type]
27-
aliases_type_statement.py:47: error: PEP 695 type aliases are not yet supported [valid-type]
28-
aliases_type_statement.py:48: error: PEP 695 type aliases are not yet supported [valid-type]
29-
aliases_type_statement.py:48: error: Function "list" could always be true in boolean context [truthy-function]
30-
aliases_type_statement.py:49: error: PEP 695 type aliases are not yet supported [valid-type]
31-
aliases_type_statement.py:52: error: PEP 695 type aliases are not yet supported [valid-type]
32-
aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type]
33-
aliases_type_statement.py:58: error: PEP 695 type aliases are not yet supported [valid-type]
34-
aliases_type_statement.py:64: error: PEP 695 type aliases are not yet supported [valid-type]
35-
aliases_type_statement.py:64: error: Name "K" is not defined [name-defined]
36-
aliases_type_statement.py:69: error: PEP 695 type aliases are not yet supported [valid-type]
37-
aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type]
38-
aliases_type_statement.py:72: error: Name "T" is not defined [name-defined]
39-
aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
40-
aliases_type_statement.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
41-
aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
42-
aliases_type_statement.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
43-
aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
44-
aliases_type_statement.py:75: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
45-
aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type]
46-
aliases_type_statement.py:77: error: Name "P" is not defined [name-defined]
47-
aliases_type_statement.py:77: error: Name "T" is not defined [name-defined]
48-
aliases_type_statement.py:77: error: Name "S" is not defined [name-defined]
49-
aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
50-
aliases_type_statement.py:77: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
51-
aliases_type_statement.py:79: error: Unexpected "..." [misc]
52-
aliases_type_statement.py:79: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
53-
aliases_type_statement.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
54-
aliases_type_statement.py:80: error: Unexpected "..." [misc]
55-
aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
56-
aliases_type_statement.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
57-
aliases_type_statement.py:81: error: Unexpected "..." [misc]
58-
aliases_type_statement.py:81: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
59-
aliases_type_statement.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
60-
aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type]
61-
aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
62-
aliases_type_statement.py:82: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
63-
aliases_type_statement.py:84: error: PEP 695 type aliases are not yet supported [valid-type]
64-
aliases_type_statement.py:84: error: Name "RecursiveTypeAlias3" is not defined [name-defined]
65-
aliases_type_statement.py:86: error: PEP 695 type aliases are not yet supported [valid-type]
66-
aliases_type_statement.py:86: error: Name "T" is not defined [name-defined]
67-
aliases_type_statement.py:86: error: Cannot determine type of "RecursiveTypeAlias4" [has-type]
68-
aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type]
69-
aliases_type_statement.py:88: error: Name "T" is not defined [name-defined]
70-
aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type]
71-
aliases_type_statement.py:88: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
72-
aliases_type_statement.py:90: error: PEP 695 type aliases are not yet supported [valid-type]
9+
aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" [attr-defined]
10+
aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator]
11+
aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined]
12+
aliases_type_statement.py:31: error: Parameterized generics cannot be used with class or instance checks [misc]
13+
aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "_ClassInfo" [arg-type]
14+
aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type]
15+
aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type]
16+
aliases_type_statement.py:39: error: Invalid type alias: expression is not a valid type [valid-type]
17+
aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type [valid-type]
18+
aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type [valid-type]
19+
aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type [valid-type]
20+
aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type [valid-type]
21+
aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type [valid-type]
22+
aliases_type_statement.py:45: error: Variable "aliases_type_statement.var1" is not valid as a type [valid-type]
23+
aliases_type_statement.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
24+
aliases_type_statement.py:46: error: Invalid type: try using Literal[True] instead? [valid-type]
25+
aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? [valid-type]
26+
aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type [valid-type]
27+
aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type [valid-type]
28+
aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef]
29+
aliases_type_statement.py:64: error: All type parameters should be declared ("V" not declared) [valid-type]
30+
aliases_type_statement.py:69: error: All type parameters should be declared ("T1" not declared) [valid-type]
31+
aliases_type_statement.py:79: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var]
32+
aliases_type_statement.py:81: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var]
33+
aliases_type_statement.py:84: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc]
34+
aliases_type_statement.py:86: error: Invalid recursive alias: a union item of itself [misc]
35+
aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc]
7336
aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]
74-
aliases_type_statement.py:90: error: Name "RecursiveTypeAlias7" is used before definition [used-before-def]
75-
aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type]
37+
aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]
7638
"""
7739
conformance_automated = "Fail"
7840
errors_diff = """
79-
Line 17: Expected 1 errors
80-
Line 19: Expected 1 errors
8141
Line 26: Expected 1 errors
82-
Line 31: Expected 1 errors
83-
Line 8: Unexpected errors ['aliases_type_statement.py:8: error: PEP 695 type aliases are not yet supported [valid-type]']
84-
Line 9: Unexpected errors ['aliases_type_statement.py:9: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:9: error: Name "S3" is not defined [name-defined]', 'aliases_type_statement.py:9: error: Name "S1" is not defined [name-defined]', 'aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined]']
85-
Line 10: Unexpected errors ['aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index]']
86-
Line 14: Unexpected errors ['aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type]']
87-
Line 21: Unexpected errors ['aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined]']
88-
Line 54: Unexpected errors ['aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type]']
89-
Line 72: Unexpected errors ['aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:72: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]']
90-
Line 74: Unexpected errors ['aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]']
91-
Line 75: Unexpected errors ['aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]']
92-
Line 77: Unexpected errors ['aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:77: error: Name "P" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Name "S" is not defined [name-defined]', 'aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]']
93-
Line 80: Unexpected errors ['aliases_type_statement.py:80: error: Unexpected "..." [misc]', 'aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]']
94-
Line 82: Unexpected errors ['aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type]', 'aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]']
95-
Line 88: Unexpected errors ['aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type]', 'aliases_type_statement.py:88: error: Name "T" is not defined [name-defined]', 'aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type]']
96-
Line 91: Unexpected errors ['aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type]']
42+
Line 52: Expected 1 errors
43+
Line 58: Expected 1 errors
44+
Line 54: Unexpected errors ['aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef]']
45+
Line 91: Unexpected errors ['aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]']
9746
"""

conformance/results/mypy/aliases_typealiastype.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ conformant = "Partial"
22
notes = """
33
Incorrectly rejects some recursive type aliases using TypeAliasType.
44
Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.
5-
Generates error when accessing `__value__` attribute of TypeAliasType.
65
"""
76
output = """
87
aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]
98
aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]
109
aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]
1110
aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]
12-
aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined]
13-
aliases_typealiastype.py:32: error: "type[int]" has no attribute "other_attrib" [attr-defined]
11+
aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined]
1412
aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" [type-var]
1513
aliases_typealiastype.py:43: error: Type variable "S" is not included in type_params [valid-type]
1614
aliases_typealiastype.py:44: error: Type variable "S" is not included in type_params [valid-type]
@@ -43,5 +41,4 @@ Line 19: Unexpected errors ['aliases_typealiastype.py:19: error: Cannot resolve
4341
Line 20: Unexpected errors ['aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]']
4442
Line 22: Unexpected errors ['aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]']
4543
Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]']
46-
Line 30: Unexpected errors ['aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined]']
4744
"""

0 commit comments

Comments
 (0)