Skip to content
Open
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
12 changes: 6 additions & 6 deletions conformance/results/mypy/generics_self_advanced.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Does not retain `Self` when accessing attribute through `type[Self]`.
"""
output = """
generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]
generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:41: error: Expression is of type "ChildB", not "Self" [assert-type]
generics_self_advanced.py:45: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]
generics_self_advanced.py:51: error: Expression is of type "ChildB", not "Self" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]']
Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 41: Unexpected errors ['generics_self_advanced.py:41: error: Expression is of type "ChildB", not "Self" [assert-type]']
Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]']
Line 51: Unexpected errors ['generics_self_advanced.py:51: error: Expression is of type "ChildB", not "Self" [assert-type]']
"""
8 changes: 4 additions & 4 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h3>Python Type System Conformance Test Results</h3>
</th>
<th class='tc-header'><div class='tc-name'>pyright 1.1.408</div>
</th>
<th class='tc-header'><div class='tc-name'>zuban 0.6.1</div>
<th class='tc-header'><div class='tc-name'>zuban 0.6.2</div>
</th>
<th class='tc-header'><div class='tc-name'>pyrefly 0.56.0</div>
</th>
Expand Down Expand Up @@ -227,7 +227,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typeforms_typeform</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support assigning Union and GenericAlias objects to their runtime types.</p></span></div></th>
<th class="column col2 not-conformant">Unsupported</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>TypeForm[Any] is not considered equivalent to itself.</p></span></div></th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 not-conformant">Unsupported</th>
<th class="column col2 not-conformant">Unsupported</th>
</tr>
Expand Down Expand Up @@ -345,7 +345,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_self_advanced</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not infer the type of an unannotated `self` parameter to be type `Self`.</p><p>Does not retain `Self` when calling method that returns `Self`.</p><p>Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.</p><p>Does not retain `Self` when accessing attribute through `type[Self]`.</p></span></div></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>Doesn't allow accessing `Self` in a classmethod</p></span></div></th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant"><div class="hover-text">Pass*<span class="tooltip-text" id="bottom"><p>Treats attributes not initialized on the class as instance-only</p></span></div></th>
<th class="column col2 conformant">Pass</th>
</tr>
Expand Down Expand Up @@ -837,7 +837,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataclasses_hash</th>
<th class="column col2 not-conformant"><div class="hover-text">Unsupported<span class="tooltip-text" id="bottom"><p>Does not synthesize `__hash__ = None` as a class attribute for unhashable dataclasses.</p><p>Does not report when an unhashable dataclass has `__hash__` called directly on an instance.</p><p>Does not report when dataclass is not compatible with Hashable protocol.</p></span></div></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>Does not synthesize a `__hash__ = None` class attribute for unhashable dataclasses.</p></span></div></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>Understands the `Hashable` protocol as equivalent to `object`.</p></span></div></th>
</tr>
Expand Down
18 changes: 7 additions & 11 deletions conformance/results/zuban/dataclasses_hash.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
conformance_automated = "Fail"
conformant = "Partial"
notes = """
Does not synthesize a `__hash__ = None` class attribute for unhashable dataclasses.
"""
conformance_automated = "Pass"
errors_diff = """
Line 14: Unexpected errors ['dataclasses_hash.py:14: error: Expression is of type "Callable[[object], int]", not "None" [misc]']
Line 36: Unexpected errors ['dataclasses_hash.py:36: error: Expression is of type "Callable[[object], int]", not "None" [misc]']
"""
output = """
dataclasses_hash.py:14: error: Expression is of type "Callable[[object], int]", not "None" [misc]
dataclasses_hash.py:17: error: "DC1" has no attribute "__hash__" [attr-defined]
dataclasses_hash.py:17: error: "None" not callable [operator]
dataclasses_hash.py:18: error: Incompatible types in assignment (expression has type "DC1", variable has type "Hashable") [assignment]
dataclasses_hash.py:36: error: Expression is of type "Callable[[object], int]", not "None" [misc]
dataclasses_hash.py:39: error: "DC3" has no attribute "__hash__" [attr-defined]
dataclasses_hash.py:18: note: Following member(s) of "DC1" have conflicts:
dataclasses_hash.py:18: note: __hash__: expected "Callable[[], int]", got "None"
dataclasses_hash.py:39: error: "None" not callable [operator]
dataclasses_hash.py:40: error: Incompatible types in assignment (expression has type "DC3", variable has type "Hashable") [assignment]
dataclasses_hash.py:40: note: Following member(s) of "DC3" have conflicts:
dataclasses_hash.py:40: note: __hash__: expected "Callable[[], int]", got "None"
"""
11 changes: 2 additions & 9 deletions conformance/results/zuban/generics_self_advanced.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
conformant = "Partial"
notes = """
Doesn't allow accessing `Self` in a classmethod
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc]']
Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc]']
"""
output = """
generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc]
generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc]
generics_self_advanced.py:48: error: Access to generic instance variables via class is ambiguous [misc]
"""
8 changes: 1 addition & 7 deletions conformance/results/zuban/typeforms_typeform.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
conformant = "Partial"
notes = """
TypeForm[Any] is not considered equivalent to itself.
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 41: Unexpected errors ['typeforms_typeform.py:41: error: Expression is of type "typing.TypeForm(Any)", not "typing.TypeForm(Any)" [misc]']
"""
output = """
typeforms_typeform.py:23: error: Incompatible types in assignment (expression has type "typing.TypeForm(str | int)", variable has type "typing.TypeForm(str | None)") [assignment]
typeforms_typeform.py:24: error: Incompatible types in assignment (expression has type "type[list[str | None]]", variable has type "typing.TypeForm(str | None)") [assignment]
typeforms_typeform.py:41: error: Expression is of type "typing.TypeForm(Any)", not "typing.TypeForm(Any)" [misc]
typeforms_typeform.py:59: error: Invalid syntax [syntax]
typeforms_typeform.py:67: error: Invalid type comment or annotation [valid-type]
typeforms_typeform.py:68: error: Syntax error in type annotation [valid-type]
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/zuban/version.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "zuban 0.6.1"
version = "zuban 0.6.2"
14 changes: 10 additions & 4 deletions conformance/tests/generics_self_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ class ChildB(ParentB):

def method2(self) -> None:
assert_type(self, Self)
assert_type(self.a, list[Self])
assert_type(self.a[0], Self)
# Allow type checkers to error here, since Self definitions on
# non-final classes are unsound.
a = self.a # E?
assert_type(a, list[Self])
assert_type(a[0], Self)
assert_type(self.method1(), Self)

@classmethod
def method3(cls) -> None:
assert_type(cls, type[Self])
assert_type(cls.a, list[Self])
assert_type(cls.a[0], Self)
# Allow type checkers to error here, since Self definitions on
# non-final classes are unsound.
a = cls.a # E?
assert_type(a, list[Self])
assert_type(a[0], Self)
assert_type(cls.method1(), Self)
26 changes: 13 additions & 13 deletions conformance/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.