You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -80,7 +81,7 @@ Note that some type checkers may not run on some platforms. If a type checker fa
80
81
81
82
Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed.
82
83
83
-
Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, and zuban. It is the goal and desire to add additional type checkers over time.
84
+
Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban and ty. It is the goal and desire to add additional type checkers over time.
aliases_recursive.py:20: error: List item 1 has incompatible type "complex"; expected "int | str | float | list[Json] | dict[str, Json] | None" [list-item]
5
5
aliases_recursive.py:38: error: Incompatible types in assignment (expression has type "tuple[int, tuple[str, int], tuple[int, tuple[int, list[int]]]]", variable has type "RecursiveTuple") [assignment]
6
-
aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef]
6
+
aliases_recursive.py:39: error: Incompatible types in assignment (expression has type "tuple[int, list[int]]", variable has type "RecursiveTuple") [assignment]
7
7
aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
8
8
aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
9
9
aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
Copy file name to clipboardExpand all lines: conformance/results/mypy/enums_members.toml
+17-25Lines changed: 17 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -9,31 +9,23 @@ Does not treat attributes with private names as non-members.
9
9
"""
10
10
conformance_automated = "Fail"
11
11
errors_diff = """
12
-
Line 82: Expected 1 errors
13
-
Line 83: Expected 1 errors
14
-
Line 129: Expected 1 errors
15
-
Line 27: Unexpected errors ['enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]']
16
-
Line 28: Unexpected errors ['enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]']
17
-
Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]']
18
-
Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]']
19
-
Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]']
20
-
Line 117: Unexpected errors ['enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]']
12
+
Line 86: Expected 1 errors
13
+
Line 87: Expected 1 errors
14
+
Line 133: Expected 1 errors
15
+
Line 104: Unexpected errors ['enums_members.py:104: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]']
16
+
Line 121: Unexpected errors ['enums_members.py:121: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:121: error: Parameter 1 of Literal[...] is invalid [valid-type]']
21
17
"""
22
18
output = """
23
-
enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]
24
-
enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]
25
-
enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]
26
-
enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]
27
-
enums_members.py:50: error: Enum members must be left unannotated [misc]
28
-
enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
29
-
enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type]
30
-
enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type]
31
-
enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]
32
-
enums_members.py:116: error: Expression is of type "int", not "Literal[Example.b]" [assert-type]
33
-
enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]
34
-
enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]
35
-
enums_members.py:128: note: Revealed type is "Any"
36
-
enums_members.py:128: note: 'reveal_type' always outputs 'Any' in unchecked functions
37
-
enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type]
38
-
enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type]
19
+
enums_members.py:54: error: Enum members must be left unannotated [misc]
20
+
enums_members.py:54: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
21
+
enums_members.py:88: error: Parameter 1 of Literal[...] is invalid [valid-type]
22
+
enums_members.py:89: error: Parameter 1 of Literal[...] is invalid [valid-type]
23
+
enums_members.py:104: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]
24
+
enums_members.py:120: error: Expression is of type "int", not "Literal[Example.b]" [assert-type]
25
+
enums_members.py:121: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]
26
+
enums_members.py:121: error: Parameter 1 of Literal[...] is invalid [valid-type]
27
+
enums_members.py:132: note: Revealed type is "Any"
28
+
enums_members.py:132: note: 'reveal_type' always outputs 'Any' in unchecked functions
29
+
enums_members.py:150: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type]
30
+
enums_members.py:151: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type]
Does not correctly handle defaults referencing other TypeVars.
4
+
"""
2
5
output = """
3
6
generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]
4
-
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
5
-
generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
6
-
generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc]
7
-
generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]
7
+
generics_defaults_referential.py:38: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
8
+
generics_defaults_referential.py:54: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
9
+
generics_defaults_referential.py:75: error: TypeVar default must be one of the constraint types [misc]
8
10
generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]
9
-
generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
11
+
generics_defaults_referential.py:79: error: TypeVar default must be one of the constraint types [misc]
12
+
generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
10
13
"""
11
14
conformance_automated = "Fail"
12
15
errors_diff = """
13
-
Line 36: Expected 1 errors
14
-
Line 60: Expected 1 errors
15
-
Line 68: Expected 1 errors
16
+
Line 37: Expected 1 errors
17
+
Line 61: Expected 1 errors
18
+
Line 69: Expected 1 errors
16
19
Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[StartT, StopT, StepT]]", not "type[slice[int, int, int | None]]" [assert-type]']
17
-
Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]']
18
-
Line 103: Unexpected errors ['generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
20
+
Line 78: Unexpected errors ['generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]']
21
+
Line 104: Unexpected errors ['generics_defaults_referential.py:104: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
Does not correctly resolve defaults when classes are used directly.
4
+
"""
2
5
output = """
3
6
generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg]
4
-
generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[DefaultStrT]]", not "type[Bar[str]]" [assert-type]
5
-
generics_defaults_specialization.py:55: error: The type "type[Foo]" is not generic and not indexable [misc]
7
+
generics_defaults_specialization.py:56: error: The type "type[Foo]" is not generic and not indexable [misc]
6
8
"""
7
9
conformance_automated = "Fail"
8
10
errors_diff = """
9
-
Line 45: Unexpected errors ['generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[DefaultStrT]]", not "type[Bar[str]]" [assert-type]']
0 commit comments