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
10 changes: 5 additions & 5 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h3>Python Type System Conformance Test Results</h3>
</th>
<th class='tc-header'><div class='tc-name'>pyrefly 0.58.0</div>
</th>
<th class='tc-header'><div class='tc-name'>ty 0.0.28</div>
<th class='tc-header'><div class='tc-name'>ty 0.0.29</div>
</th>
</tr>
<tr><th class="column" colspan="6">
Expand Down Expand Up @@ -725,28 +725,28 @@ <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>Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.</p><p>Does not reject class-scoped type variables used in the `self` annotation.</p><p>Does not support inferring type variables for generic classes where the `__init__` method uses method-scoped type variables.</p></span></div></th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.</p><p>Does not reject class-scoped type variables used in the `self` annotation.</p></span></div></th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constructors_call_metaclass</th>
<th class="column col2 not-conformant"><div class="hover-text">Unsupported<span class="tooltip-text" id="bottom"><p>Does not honor metaclass __call__ method when evaluating constructor call.</p><p>Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.</p></span></div></th>
<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 not-conformant">Unsupported</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>
</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>
<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 not-conformant">Unsupported</th>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constructors_call_type</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not validate call to custom metaclass __call__ method through type[T].</p></span></div></th>
<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>Does not support metaclass `__call__`.</p><p>Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound.</p></span></div></th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound.</p></span></div></th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constructors_callable</th>
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not generate a union type for __new__ and __init__ when converting class to callable.</p><p>Does not ignore __init__ based on __new__ return type when converting class to callable.</p><p>Does not support __new__ return type that is different from class being constructed.</p></span></div></th>
Expand Down
5 changes: 0 additions & 5 deletions conformance/results/ty/constructors_call_init.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ conformant = "Partial"
notes = """
Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.
Does not reject class-scoped type variables used in the `self` annotation.
Does not support inferring type variables for generic classes where the `__init__` method uses method-scoped type variables.
"""
errors_diff = """
Line 42: Expected 1 errors
Line 107: Expected 1 errors
Line 91: Unexpected errors ['constructors_call_init.py:91:1: error[type-assertion-failure] Type `Class6[Unknown, Unknown]` does not match asserted type `Class6[int, str]`']
Line 99: Unexpected errors ['constructors_call_init.py:99:1: error[type-assertion-failure] Type `Class7[Unknown, Unknown]` does not match asserted type `Class7[str, int]`']
"""
output = """
constructors_call_init.py:21:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `float`
constructors_call_init.py:56:1: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Class4[int]`, found `Class4[str]`
constructors_call_init.py:91:1: error[type-assertion-failure] Type `Class6[Unknown, Unknown]` does not match asserted type `Class6[int, str]`
constructors_call_init.py:99:1: error[type-assertion-failure] Type `Class7[Unknown, Unknown]` does not match asserted type `Class7[str, int]`
constructors_call_init.py:130:9: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
"""
8 changes: 4 additions & 4 deletions conformance/results/ty/constructors_call_metaclass.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
conformance_automated = "Fail"
conformant = "Unsupported"
conformant = "Partial"
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.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might argue that this is a true positive (albeit a pretty pedantic one), but that's for another PR :-)

"""
errors_diff = """
Line 39: Unexpected errors ['constructors_call_metaclass.py:39:1: error[type-assertion-failure] Type `Class2` does not match asserted type `int | Meta2`', 'constructors_call_metaclass.py:39:13: error[missing-argument] No argument provided for required parameter `x` of function `__new__`']
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:39:1: error[type-assertion-failure] Type `Class2` does not match asserted type `int | Meta2`
constructors_call_metaclass.py:39:13: error[missing-argument] No argument provided for required parameter `x` of function `__new__`
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__`
Expand Down
19 changes: 1 addition & 18 deletions conformance/results/ty/constructors_call_new.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
conformance_automated = "Fail"
conformant = "Unsupported"
conformance_automated = "Pass"
errors_diff = """
Line 49: Unexpected errors ['constructors_call_new.py:49:1: error[type-assertion-failure] Type `Class3` does not match asserted type `int`', 'constructors_call_new.py:49:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`']
Line 64: Unexpected errors ['constructors_call_new.py:64:1: error[type-assertion-failure] Type `Class4` does not match asserted type `Class4 | Any`', 'constructors_call_new.py:64:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`']
Line 76: Unexpected errors ['constructors_call_new.py:76:5: error[type-assertion-failure] Type `Class5` does not match asserted type `Never`', 'constructors_call_new.py:76:17: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`']
Line 89: Unexpected errors ['constructors_call_new.py:89:1: error[type-assertion-failure] Type `Class6` does not match asserted type `int | Class6`', 'constructors_call_new.py:89:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`']
Line 117: Unexpected errors ['constructors_call_new.py:117:1: error[type-assertion-failure] Type `Class8[int]` does not match asserted type `Class8[list[int]]`']
Line 118: Unexpected errors ['constructors_call_new.py:118:1: error[type-assertion-failure] Type `Class8[str]` does not match asserted type `Class8[list[str]]`']
"""
output = """
constructors_call_new.py:21:13: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `int`, found `float`
constructors_call_new.py:49:1: error[type-assertion-failure] Type `Class3` does not match asserted type `int`
constructors_call_new.py:49:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`
constructors_call_new.py:64:1: error[type-assertion-failure] Type `Class4` does not match asserted type `Class4 | Any`
constructors_call_new.py:64:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`
constructors_call_new.py:76:5: error[type-assertion-failure] Type `Class5` does not match asserted type `Never`
constructors_call_new.py:76:17: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`
constructors_call_new.py:89:1: error[type-assertion-failure] Type `Class6` does not match asserted type `int | Class6`
constructors_call_new.py:89:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`
constructors_call_new.py:117:1: error[type-assertion-failure] Type `Class8[int]` does not match asserted type `Class8[list[int]]`
constructors_call_new.py:118:1: error[type-assertion-failure] Type `Class8[str]` does not match asserted type `Class8[list[str]]`
constructors_call_new.py:148:1: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `type[Class11[int]]`, found `<class 'Class11[str]'>`
"""
5 changes: 2 additions & 3 deletions conformance/results/ty/constructors_call_type.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
conformance_automated = "Fail"
conformant = "Partial"
notes = """
Does not support metaclass `__call__`.
Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound.
"""
errors_diff = """
Line 30: Expected 1 errors
Line 64: Expected 1 errors
Line 72: Expected 1 errors
"""
output = """
constructors_call_type.py:19:55: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
constructors_call_type.py:30:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of bound method `__call__`
constructors_call_type.py:40:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of function `__new__`
constructors_call_type.py:50:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of bound method `__init__`
constructors_call_type.py:59:9: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
constructors_call_type.py:72:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of bound method `__call__`
constructors_call_type.py:81:5: error[missing-argument] No argument provided for required parameter `y` of function `__new__`
constructors_call_type.py:82:12: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str`, found `Literal[2]`
"""
1 change: 1 addition & 0 deletions conformance/results/ty/literals_literalstring.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ literals_literalstring.py:65:25: error[invalid-assignment] Object of type `str`
literals_literalstring.py:73:25: error[invalid-assignment] Object of type `Literal[3]` is not assignable to `LiteralString`
literals_literalstring.py:74:25: error[invalid-assignment] Object of type `Literal[b"test"]` is not assignable to `LiteralString`
literals_literalstring.py:119:22: error[invalid-argument-type] Argument to function `literal_identity` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `TLiteral`
literals_literalstring.py:133:41: error[invalid-assignment] Object of type `Container[T@Container]` is not assignable to `Container[LiteralString]`
literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `T`
literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `LiteralString`, found `str`
literals_literalstring.py:171:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]`
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/ty/version.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "ty 0.0.28"
version = "ty 0.0.29"
Loading