From d11ce4d6d2e05a0e19e5e5e34adae1280807dd0b Mon Sep 17 00:00:00 2001 From: Daniil Kalinin Date: Wed, 28 May 2025 13:43:06 +0200 Subject: [PATCH 1/2] conformance: fix missing(?) # E error comment in dataclasses_inheritance.py --- conformance/tests/dataclasses_inheritance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/dataclasses_inheritance.py b/conformance/tests/dataclasses_inheritance.py index 7468e379c..fe6263e68 100644 --- a/conformance/tests/dataclasses_inheritance.py +++ b/conformance/tests/dataclasses_inheritance.py @@ -44,7 +44,7 @@ class DC4(DC3): class DC5: # This should generate an error because a default value of # type list, dict, or set generate a runtime error. - x: list[int] = [] + x: list[int] = [] # E @dataclass From 5e8b4f93b88441735797780dba64e829ec52aeec Mon Sep 17 00:00:00 2001 From: Daniil Kalinin Date: Thu, 29 May 2025 10:09:24 +0200 Subject: [PATCH 2/2] conformance: update the results after changes in `dataclasses_inheritance.py` --- .../results/mypy/dataclasses_inheritance.toml | 8 ++++++-- conformance/results/mypy/version.toml | 2 +- .../results/pyre/dataclasses_inheritance.toml | 2 ++ conformance/results/pyre/version.toml | 2 +- .../pyright/dataclasses_inheritance.toml | 8 ++++++-- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 20 +++++++++---------- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/conformance/results/mypy/dataclasses_inheritance.toml b/conformance/results/mypy/dataclasses_inheritance.toml index 5f7dcc312..1345599e0 100644 --- a/conformance/results/mypy/dataclasses_inheritance.toml +++ b/conformance/results/mypy/dataclasses_inheritance.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). +""" output = """ dataclasses_inheritance.py:60: error: Cannot override instance variable (previously declared on base class "DC6") with class variable [misc] dataclasses_inheritance.py:64: error: Cannot override class variable (previously declared on base class "DC6") with instance variable [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index eb3ca14aa..a62332be1 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.16.0" -test_duration = 1.7 +test_duration = 2.0 diff --git a/conformance/results/pyre/dataclasses_inheritance.toml b/conformance/results/pyre/dataclasses_inheritance.toml index eb0547dd5..4ace5b68c 100644 --- a/conformance/results/pyre/dataclasses_inheritance.toml +++ b/conformance/results/pyre/dataclasses_inheritance.toml @@ -1,5 +1,6 @@ conformant = "Partial" notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). Does not reject ClassVar that is overridden by instance variable. Does not reject instance variable that is overridden by ClassVar. """ @@ -7,6 +8,7 @@ output = """ """ conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors Line 60: Expected 1 errors Line 64: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index bffc62991..5b949f6ad 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 5.7 +test_duration = 9.1 diff --git a/conformance/results/pyright/dataclasses_inheritance.toml b/conformance/results/pyright/dataclasses_inheritance.toml index a77817ee2..935f8e918 100644 --- a/conformance/results/pyright/dataclasses_inheritance.toml +++ b/conformance/results/pyright/dataclasses_inheritance.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not report when the default value of dataclass field is mutable (is of type list, dict, or set). +""" output = """ dataclasses_inheritance.py:60:5 - error: Class variable "x" overrides instance variable of same name in class "DC6" (reportIncompatibleVariableOverride) dataclasses_inheritance.py:64:5 - error: Instance variable "y" overrides class variable of same name in class "DC6" (reportIncompatibleVariableOverride) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 47: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 9fe613445..32f55ae40 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.401" -test_duration = 1.1 +test_duration = 1.4 diff --git a/conformance/results/results.html b/conformance/results/results.html index 6464e5c47..b50f2db9d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

Python Type System Conformance Test Results

- + @@ -404,7 +404,7 @@

Python Type System Conformance Test Results

- + @@ -597,7 +597,7 @@

Python Type System Conformance Test Results

- + @@ -643,9 +643,9 @@

Python Type System Conformance Test Results

- - - + + + @@ -779,7 +779,7 @@

Python Type System Conformance Test Results

- +
 
mypy 1.16.0
-
1.7sec
+
2.0sec
pyright 1.1.401
-
1.1sec
+
1.4sec
pyre 0.9.23
-
5.7sec
+
9.1sec
@@ -353,7 +353,7 @@

Python Type System Conformance Test Results

Unsupported

Does not support star expressions for `Unpack`.

     generics_typevartuple_specialization
Partial

Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

"More than one Unpack" error message has no line number.

Partial

Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

Pass
Unsupported

Does not support star expressions for `Unpack`.

Partial

Does not reject use of TypeVar in ClassVar.

Does not reject use of ParamSpec in ClassVar.

Does not reject use of ClassVar as a generic type argument.

Does not reject use of ClassVar in parameter type annotation.

Does not reject use of ClassVar in local variable annotation.

Does not reject use of ClassVar in instance variable annotation.

Does not reject use of ClassVar in return type annotation.

Does not reject use of ClassVar in type alias definition.

Does not infer type from initialization for bare ClassVar.

     classes_override
Partial

Does not handle case where parent class derives from Any.

Pass Pass Pass
Partial

Does not apply decorator transforms before checking overload consistency.

     overloads_definitions
Partial

Does not allow an overload with no implementation in an abstract base class.

Allows @override to be on all overloads and implementation, instead of just implementation.

Partial

Allows @override to be on all overloads and implementation, instead of just implementation.

Pass
Partial

Does not allow an overload with no implementation in a Protocol or an abstract base class.

Expects @final/@override on all overloads and implementation, instead of implementation only.

Partial

Does not report when dataclass is not compatible with Hashable protocol.

     dataclasses_inheritancePassPass
Partial

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

Partial

Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

Partial

Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

Partial

Does not report when the default value of dataclass field is mutable (is of type list, dict, or set).

Does not reject ClassVar that is overridden by instance variable.

Does not reject instance variable that is overridden by ClassVar.

     dataclasses_kwonly
Partial

Incorrectly rejects kw_only field with default before positional field.

Pass
     tuples_unpacked
Partial

"More than one unpack" error is missing a line number.

Partial

"More than one unpack" error is missing in some cases.

Pass Pass