From f5930a56f247d721c6affb8d6ff5e1a40f75769e Mon Sep 17 00:00:00 2001 From: yangdanny97 Date: Thu, 17 Jul 2025 22:24:19 -0400 Subject: [PATCH 1/3] edit error markers and regenerate results --- .../results/mypy/aliases_recursive.toml | 2 +- .../results/mypy/classes_classvar.toml | 2 +- .../results/mypy/dataclasses_kwonly.toml | 19 ++----------------- .../results/mypy/directives_reveal_type.toml | 2 +- conformance/results/mypy/enums_behaviors.toml | 4 +++- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/enums_behaviors.toml | 4 +++- .../generics_paramspec_specialization.toml | 4 ---- .../pyre/qualifiers_final_decorator.toml | 4 ++-- conformance/results/pyre/version.toml | 4 ++-- .../results/pyright/enums_behaviors.toml | 4 +++- conformance/results/pyright/version.toml | 4 ++-- conformance/results/results.html | 16 ++++++++-------- conformance/tests/enums_behaviors.py | 11 ++++++++--- .../tests/qualifiers_final_decorator.py | 6 +++--- 15 files changed, 41 insertions(+), 49 deletions(-) diff --git a/conformance/results/mypy/aliases_recursive.toml b/conformance/results/mypy/aliases_recursive.toml index 01af644dc..5272c3212 100644 --- a/conformance/results/mypy/aliases_recursive.toml +++ b/conformance/results/mypy/aliases_recursive.toml @@ -6,7 +6,7 @@ aliases_recursive.py:38: error: Incompatible types in assignment (expression has aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef] aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] -aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] +aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "dict[str, str | int | list[int]]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item] aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item] aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item] aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself [misc] diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 0d9662ecf..0072d63f1 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -20,6 +20,7 @@ classes_classvar.py:70: error: ClassVar can only be used for assignments in clas classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] +classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type] classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: @@ -30,6 +31,5 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, conformance_automated = "Fail" errors_diff = """ Line 47: Expected 1 errors -Line 78: Expected 1 errors Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] """ diff --git a/conformance/results/mypy/dataclasses_kwonly.toml b/conformance/results/mypy/dataclasses_kwonly.toml index 118448df3..9f83cef04 100644 --- a/conformance/results/mypy/dataclasses_kwonly.toml +++ b/conformance/results/mypy/dataclasses_kwonly.toml @@ -1,24 +1,9 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects kw_only field with default before positional field. -""" +conformant = "Pass" output = """ dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [misc] -dataclasses_kwonly.py:29: error: Attributes without a default cannot follow attributes with one [misc] -dataclasses_kwonly.py:32: error: Too many positional arguments for "DC2" [misc] -dataclasses_kwonly.py:32: error: Too few arguments for "DC2" [call-arg] -dataclasses_kwonly.py:32: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_kwonly.py:35: error: "DC2" gets multiple values for keyword argument "b" [misc] -dataclasses_kwonly.py:35: error: Too few arguments for "DC2" [call-arg] -dataclasses_kwonly.py:35: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [misc] -dataclasses_kwonly.py:38: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type] -dataclasses_kwonly.py:38: error: Argument 2 to "DC2" has incompatible type "int"; expected "str" [arg-type] dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [misc] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 29: Unexpected errors ['dataclasses_kwonly.py:29: error: Attributes without a default cannot follow attributes with one [misc]'] -Line 32: Unexpected errors ['dataclasses_kwonly.py:32: error: Too many positional arguments for "DC2" [misc]', 'dataclasses_kwonly.py:32: error: Too few arguments for "DC2" [call-arg]', 'dataclasses_kwonly.py:32: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]'] -Line 35: Unexpected errors ['dataclasses_kwonly.py:35: error: "DC2" gets multiple values for keyword argument "b" [misc]', 'dataclasses_kwonly.py:35: error: Too few arguments for "DC2" [call-arg]', 'dataclasses_kwonly.py:35: error: Argument 1 to "DC2" has incompatible type "str"; expected "int" [arg-type]'] """ diff --git a/conformance/results/mypy/directives_reveal_type.toml b/conformance/results/mypy/directives_reveal_type.toml index 8621a0083..c5853ba33 100644 --- a/conformance/results/mypy/directives_reveal_type.toml +++ b/conformance/results/mypy/directives_reveal_type.toml @@ -1,6 +1,6 @@ conformant = "Pass" output = """ -directives_reveal_type.py:14: note: Revealed type is "Union[builtins.int, builtins.str]" +directives_reveal_type.py:14: note: Revealed type is "builtins.int | builtins.str" directives_reveal_type.py:15: note: Revealed type is "builtins.list[builtins.int]" directives_reveal_type.py:16: note: Revealed type is "Any" directives_reveal_type.py:17: note: Revealed type is "directives_reveal_type.ForwardReference" diff --git a/conformance/results/mypy/enums_behaviors.toml b/conformance/results/mypy/enums_behaviors.toml index 80498e652..a3193b611 100644 --- a/conformance/results/mypy/enums_behaviors.toml +++ b/conformance/results/mypy/enums_behaviors.toml @@ -2,6 +2,8 @@ conformant = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39: error: Cannot extend enum with existing members: "Shape" [misc] +enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" [assert-type] +enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" [assert-type] +enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" [misc] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index d3740879d..3c192fd9a 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.16.1" -test_duration = 2.2 +version = "mypy 1.17.0" +test_duration = 1.9 diff --git a/conformance/results/pyre/enums_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml index 49c045e26..d1c240fc8 100644 --- a/conformance/results/pyre/enums_behaviors.toml +++ b/conformance/results/pyre/enums_behaviors.toml @@ -5,5 +5,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. +enums_behaviors.py:28:0 Assert type [70]: Expected `typing_extensions.Literal[Color.RED]` but got `Color`. +enums_behaviors.py:32:0 Assert type [70]: Expected `typing_extensions.Literal[Color.BLUE]` but got `Color`. +enums_behaviors.py:44:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. """ diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index 34a215ee6..d4da441aa 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -3,8 +3,6 @@ notes = """ Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ -generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB. -generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA. generics_paramspec_specialization.py:44:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. @@ -15,8 +13,6 @@ generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnl """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ['generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] -Line 36: Unexpected errors ['generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] """ diff --git a/conformance/results/pyre/qualifiers_final_decorator.toml b/conformance/results/pyre/qualifiers_final_decorator.toml index ef5be734e..09c5e28b2 100644 --- a/conformance/results/pyre/qualifiers_final_decorator.toml +++ b/conformance/results/pyre/qualifiers_final_decorator.toml @@ -18,7 +18,7 @@ qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be """ conformance_automated = "Fail" errors_diff = """ -Lines 80, 89: Expected error (tag 'Derived3') -Lines 94, 102: Expected error (tag 'Derived4') +Lines 80, 81, 89: Expected error (tag 'Derived3') +Lines 94, 95, 102: Expected error (tag 'Derived4') Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index c759e78d0..de515ba2e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ -version = "pyre 0.9.23" -test_duration = 10.7 +version = "pyre 0.9.25" +test_duration = 7.4 diff --git a/conformance/results/pyright/enums_behaviors.toml b/conformance/results/pyright/enums_behaviors.toml index 8a9ff77e3..3d5c93daa 100644 --- a/conformance/results/pyright/enums_behaviors.toml +++ b/conformance/results/pyright/enums_behaviors.toml @@ -2,6 +2,8 @@ conformant = "Pass" errors_diff = """ """ output = """ -enums_behaviors.py:39:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues) +enums_behaviors.py:28:13 - error: "assert_type" mismatch: expected "Literal[Color.RED]" but received "Color" (reportAssertTypeFailure) +enums_behaviors.py:32:13 - error: "assert_type" mismatch: expected "Literal[Color.BLUE]" but received "Color" (reportAssertTypeFailure) +enums_behaviors.py:44:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index ca4eb79ca..79f18fab5 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.402" -test_duration = 1.8 +version = "pyright 1.1.403" +test_duration = 1.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 4cc4ea005..75697316b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

Python Type System Conformance Test Results

- - - - + @@ -423,7 +423,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/tests/enums_behaviors.py b/conformance/tests/enums_behaviors.py index fa3aeec7d..eeb74ddfd 100644 --- a/conformance/tests/enums_behaviors.py +++ b/conformance/tests/enums_behaviors.py @@ -5,7 +5,7 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-definition from enum import Enum -from typing import assert_type +from typing import assert_type, Literal # > Enum classes are iterable and indexable, and they can be called with a # > value to look up the enum member with that value. Type checkers should @@ -23,8 +23,13 @@ class Color(Enum): # > constructor. Instead, the call performs a value-based lookup of an # > enum member. -assert_type(Color["RED"], Color) # 'Literal[Color.RED]' is also acceptable -assert_type(Color(3), Color) # 'Literal[Color.BLUE]' is also acceptable +# 'Literal[Color.RED]' and 'Color' are both acceptable +assert_type(Color["RED"], Color) # E[red] +assert_type(Color["RED"], Literal[Color.RED]) # E[red] + +# 'Literal[Color.BLUE]' and 'Color' are both acceptable +assert_type(Color(3), Color) # E[blue] +assert_type(Color(3), Literal[Color.BLUE]) # E[blue] # > An Enum class with one or more defined members cannot be subclassed. diff --git a/conformance/tests/qualifiers_final_decorator.py b/conformance/tests/qualifiers_final_decorator.py index 3523ae531..5f131f462 100644 --- a/conformance/tests/qualifiers_final_decorator.py +++ b/conformance/tests/qualifiers_final_decorator.py @@ -65,7 +65,7 @@ def method3() -> None: # E[method3] pass @overload # E[method4] - def method4(self, x: int) -> int: + def method4(self, x: int) -> int: # E[method4] ... @overload @@ -78,7 +78,7 @@ def method4(self, x: int | str) -> int | str: # E[method4] class Derived3(Base3): @overload # E[Derived3] - def method(self, x: int) -> int: + def method(self, x: int) -> int: # E[Derived3] ... @overload # E[Derived3-2] @@ -92,7 +92,7 @@ def method(self, x: int | str) -> int | str: # E[Derived3] class Derived4(Base4): @overload # E[Derived4] - def method(self, x: int) -> int: + def method(self, x: int) -> int: # E[Derived4] ... @overload From db2544b1e3f9ef44ee995483c1738e2a0e935a19 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 22 Jul 2025 16:20:02 -0700 Subject: [PATCH 2/3] Add back newline --- conformance/results/mypy/version.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 1f1feaf4f..3c192fd9a 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.17.0" -test_duration = 1.9 \ No newline at end of file +test_duration = 1.9 From 8d297279bb2745be372a317b8295c9d48bbc825a Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 22 Jul 2025 16:20:24 -0700 Subject: [PATCH 3/3] Add back newline --- conformance/results/pyre/version.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9d893e405..de515ba2e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.25" -test_duration = 7.4 \ No newline at end of file +test_duration = 7.4
 
mypy 1.16.1
-
2.2sec
+
mypy 1.17.0
+
1.9sec
pyright 1.1.402
-
1.8sec
+
pyright 1.1.403
+
1.4sec
pyre 0.9.23
-
10.7sec
+
pyre 0.9.25
+
7.4sec
@@ -324,7 +324,7 @@

Python Type System Conformance Test Results

     generics_type_erasure
Partial

Infers Node[Never] instead of Node[Any] when argument is not provided.

False negative on instance attribute access on type(node).

Partial

Missing error regarding `type(instance).generic_attribute`.

Pass
Partial

Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

False negatives on instance attribute access on the type.

Does not infer type of `DefaultDict` with explicit type parameters on constructor.

False negatives on assert_type uses.

     generics_typevartuple_args
     aliases_newtype
Partial

`NewType`s are considered classes, not functions.

Partial

`NewType`s are considered classes, not functions.

Pass
Partial

Does not reject use of NewType in `isinstance` call.

Does not reject use of NewType in class definition statement.

Does not report inconsistency between name of NewType and assigned identifier name.

Does not reject use of NewType with generic class with TypeVar.

Does not reject use of NewType with protocol class.

Does not reject use of NewType with TypedDict class.

Does not reject use of NewType with Any.

     aliases_recursive