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
2 changes: 0 additions & 2 deletions conformance/results/mypy/generics_type_erasure.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
conformant = "Partial"
notes = """
Infers `Node[Never]` instead of `Node[Any]` when argument is not provided.
False negative on instance attribute access on `type(node)`.
"""
output = """
generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]
Expand All @@ -15,7 +14,6 @@ generics_type_erasure.py:45: error: Access to generic instance variables via cla
"""
conformance_automated = "Fail"
errors_diff = """
Line 46: Expected 1 errors
Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]']
Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [assert-type]']
"""
1 change: 0 additions & 1 deletion conformance/results/results.html

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

1 change: 0 additions & 1 deletion conformance/results/ty/generics_type_erasure.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Line 42: Expected 1 errors
Line 43: Expected 1 errors
Line 44: Expected 1 errors
Line 45: Expected 1 errors
Line 46: Expected 1 errors
"""
output = """
generics_type_erasure.py:38:16: error[invalid-argument-type] Argument to `Node.__init__` is incorrect: Expected `int | None`, found `Literal[""]`
Expand Down
2 changes: 1 addition & 1 deletion conformance/tests/generics_type_erasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, label: T | None = None) -> None:
Node[int].label # E
Node.label = 1 # E
Node.label # E
type(n1).label # E
type(n1).label # E?
assert_type(n1.label, int)
assert_type(Node[int]().label, int)
n1.label = 1 # OK
Expand Down
1 change: 0 additions & 1 deletion docs/spec/generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ class instance that does not have an instance attribute with the same name::
Node[int].x # Error
Node.x = 1 # Error
Node.x # Error
type(p).x # Error
p.x # Ok (evaluates to int)
Node[int]().x # Ok (evaluates to int)
p.x = 1 # Ok, but assigning to instance attribute
Expand Down