[ty] Add support for @total_ordering#22181
Conversation
| ```py | ||
| from functools import total_ordering | ||
|
|
||
| @total_ordering |
There was a problem hiding this comment.
I wonder if we should have a dedicated diagnostic for this?
There was a problem hiding this comment.
Yeah, I think we should -- it seems like Pyright does.
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
|
Keeping in draft while I add a new diagnostic. |
|
Although that could plausibly be its own PR. |
93f81bf to
52e7d6f
Compare
|
I implemented the diagnostic in a separate PR (since it's absence here doesn't cause any false positives or false negatives on the comparators, at least): #22183 |
52e7d6f to
240fc44
Compare
guessing you mean pyx? :P |
|
Err… yes :) |
|
I'm surprised there aren't more diagnostics going away in the ecosystem. I thought |
|
I'm surprised it's not in the conformance tests! |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
4 | 2 | 5 |
unsupported-operator |
0 | 6 | 0 |
invalid-assignment |
0 | 0 | 5 |
invalid-return-type |
0 | 1 | 4 |
possibly-missing-attribute |
3 | 0 | 1 |
invalid-await |
2 | 0 | 0 |
unresolved-attribute |
0 | 0 | 2 |
unused-ignore-comment |
0 | 1 | 0 |
| Total | 9 | 10 | 17 |
carljm
left a comment
There was a problem hiding this comment.
Looks great! A few test suggestions, nothing blocking. Thank you!!
crates/ty_python_semantic/resources/mdtest/decorators/total_ordering.md
Outdated
Show resolved
Hide resolved
15b9212 to
f50ca7a
Compare
|
Thank you! |
crates/ty_python_semantic/resources/mdtest/decorators/total_ordering.md
Outdated
Show resolved
Hide resolved
f50ca7a to
815e631
Compare
Summary
We have some suppressions in the pyx codebase related to this, so wanted to resolve.
Closes astral-sh/ty#1202.