ClassVar without parameters #973
JelleZijlstra
started this conversation in
General
Replies: 2 comments
-
I think so? There's an analogy to Final to be made and PEP 591 explicitly allows naked Finals. In particular, The black code looks like it just wants a class-scoped type alias, which we recently had a big discussion about on typing-sig. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't see the harm in allowing it, but if it's allowed, at least the documentation at https://docs.python.org/3/library/typing.html should be updated. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found this code in Black:
(simplified from https://github.com/psf/black/blob/main/src/black/trans.py#L207)
PEP 526 doesn't say anything about what
ClassVar
without arguments means, but mypy and pyright both accept this code. Should they?Beta Was this translation helpful? Give feedback.
All reactions