Replies: 1 comment 2 replies
-
Pyright should not emit a diagnostic in this case. I'm going to convert this to a bug report. And yes, there is no need to annotate |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Consider the following example:
Pyright will flag a
reportInvalidTypeVarUse
over the use ofSelf
here. However, by my reading of the recent specification, this (probably?) ought to be allowed:https://github.com/python/typing/blob/b908de0205fb208cd2d74fe342ab33f28f35b71b/docs/spec/constructors.rst?plain=1#L206-L207
I am curious about what the correct resolution is for the inconsistency!
Also, in practice I am guessing that the general consensus is to discourage explicit annotation of
self
in general? e.g. I note that Ruff's ANN01 rule is deprecated.Beta Was this translation helpful? Give feedback.
All reactions