diff --git a/conformance/results/mypy/constructors_call_metaclass.toml b/conformance/results/mypy/constructors_call_metaclass.toml index 933983b1f..fb84e85db 100644 --- a/conformance/results/mypy/constructors_call_metaclass.toml +++ b/conformance/results/mypy/constructors_call_metaclass.toml @@ -7,14 +7,12 @@ conformance_automated = "Fail" errors_diff = """ Line 26: Unexpected errors ['constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg]'] Line 39: Unexpected errors ['constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg]'] -Line 46: Unexpected errors ['constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc]'] """ output = """ constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type] constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg] constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type] constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg] -constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc] constructors_call_metaclass.py:54: error: Missing positional argument "x" in call to "Class3" [call-arg] constructors_call_metaclass.py:68: error: Missing positional argument "x" in call to "Class4" [call-arg] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 3ddb751cd..051e4b900 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -732,7 +732,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Emits a diagnostic if `super().__call__()` is called in an overridden `__call__` method on a subclass of `type` and the first argument of the overridden `__call__` method is annotated with `type[T]` where `T` is a type variable with no upper bound.

+Pass      constructors_call_new
Partial

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not skip evaluation of __init__ based on __new__ return type.

Does not report errors during binding to cls parameter of __new__ method.

diff --git a/conformance/results/ty/constructors_call_metaclass.toml b/conformance/results/ty/constructors_call_metaclass.toml index b623220eb..d25ba955b 100644 --- a/conformance/results/ty/constructors_call_metaclass.toml +++ b/conformance/results/ty/constructors_call_metaclass.toml @@ -1,13 +1,10 @@ -conformance_automated = "Fail" -conformant = "Partial" +conformance_automated = "Pass" +conformant = "Pass" notes = """ -Emits a diagnostic if `super().__call__()` is called in an overridden `__call__` method on a subclass of `type` and the first argument of the overridden `__call__` method is annotated with `type[T]` where `T` is a type variable with no upper bound. """ errors_diff = """ -Line 46: Unexpected errors ["constructors_call_metaclass.py:46:16: error[invalid-super-argument] `type[T@__call__]` is not an instance or subclass of `` in `super(, type[T@__call__])` call"] """ output = """ -constructors_call_metaclass.py:46:16: error[invalid-super-argument] `type[T@__call__]` is not an instance or subclass of `` in `super(, type[T@__call__])` call constructors_call_metaclass.py:54:1: error[missing-argument] No argument provided for required parameter `x` of function `__new__` constructors_call_metaclass.py:68:1: error[missing-argument] No argument provided for required parameter `x` of function `__new__` """ diff --git a/conformance/tests/constructors_call_metaclass.py b/conformance/tests/constructors_call_metaclass.py index 3e30d1820..0a3a9df7a 100644 --- a/conformance/tests/constructors_call_metaclass.py +++ b/conformance/tests/constructors_call_metaclass.py @@ -43,7 +43,7 @@ def __new__(cls, x: int) -> Self: class Meta3(type): def __call__(cls: type[T], *args, **kwargs) -> T: - return super().__call__(*args, **kwargs) + return type.__call__(cls, *args, **kwargs) class Class3(metaclass=Meta3): @@ -57,7 +57,7 @@ def __new__(cls, x: int) -> Self: class Meta4(type): def __call__(cls, *args, **kwargs): - return super().__call__(*args, **kwargs) + return type.__call__(cls, *args, **kwargs) class Class4(metaclass=Meta4):