Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions conformance/results/mypy/constructors_call_metaclass.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""
2 changes: 1 addition & 1 deletion conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>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.</p></span></div></th>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constructors_call_new</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support __new__ return type that is not a subclass of the class being constructed.</p><p>Does not skip evaluation of __init__ based on __new__ return type.</p><p>Does not report errors during binding to cls parameter of __new__ method.</p></span></div></th>
Expand Down
7 changes: 2 additions & 5 deletions conformance/results/ty/constructors_call_metaclass.toml
Original file line number Diff line number Diff line change
@@ -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 `<class 'Meta3'>` in `super(<class 'Meta3'>, 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 `<class 'Meta3'>` in `super(<class 'Meta3'>, 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__`
"""
4 changes: 2 additions & 2 deletions conformance/tests/constructors_call_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down