[ty] Emit diagnostics for invalid base classes in type(...)#22499
[ty] Emit diagnostics for invalid base classes in type(...)#22499charliermarsh merged 4 commits intomainfrom
type(...)#22499Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
89e06a8 to
448de6d
Compare
b7f13df to
a97a987
Compare
448de6d to
147e884
Compare
a97a987 to
0d7c581
Compare
147e884 to
b252d39
Compare
0d7c581 to
68295e5
Compare
55cf50a to
8e6b92a
Compare
8e6b92a to
8f0e486
Compare
b01743a to
15c846c
Compare
8f0e486 to
e023edf
Compare
15c846c to
7729353
Compare
e023edf to
d9279bd
Compare
7729353 to
dd8e67d
Compare
d9279bd to
b5f5620
Compare
05c1afb to
5a177bb
Compare
|
Do you mean, exclusively for the protocol case? (As opposed to, e.g., inheriting from enums?) Since that one is a limitation? |
8226d16 to
98398f3
Compare
fbd2949 to
3bf7fa3
Compare
98398f3 to
3397ceb
Compare
3bf7fa3 to
e7f60c2
Compare
3397ceb to
561ec88
Compare
|
(Actually not sure if we're supposed to support |
|
My read of https://typing.python.org/en/latest/spec/qualifiers.html is that |
| ```py | ||
| from typing import final | ||
|
|
||
| FinalClass = final(type("FinalClass", (), {})) |
There was a problem hiding this comment.
can we therefore emit a diagnostic here warning the user that this has no effect? I don't like silently doing nothing in a case where the user probably expects us to do something 😄
This can be a followup.
There was a problem hiding this comment.
Will do. I think that should fire for "static" classes too.
5838767 to
3314967
Compare
crates/ty_python_semantic/resources/mdtest/diagnostics/unsupported_base_dynamic_type.md
Outdated
Show resolved
Hide resolved
3314967 to
ca1982f
Compare
AlexWaygood
left a comment
There was a problem hiding this comment.
nice, a few more minor nits
...t/snapshots/unsupported_base_dyn…_-_Unsupported_base_for…_-_Enum_base_(4873196c8b48364).snap
Outdated
Show resolved
Hide resolved
...ots/unsupported_base_dyn…_-_Unsupported_base_for…_-_`TypedDict`_base_(6f76171c88fc8760).snap
Outdated
Show resolved
Hide resolved
110383f to
791324d
Compare
e7f60c2 to
a94d0ed
Compare
791324d to
7f77f5d
Compare
Summary
Tackles a few TODOs from #22291.