Internal error when using typing.Self in specific contexts #2858
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Describe the bug
pyright will crash if
Self
is used as a generic argument to a decorator inside a classTo Reproduce
See code below, pyright emits the following error.
Expected behavior
Not actually sure what's expected here, I'd like if
Self
was allowed in the context, but I'm not sure if it's supposed to be.Screenshots or Code
If applicable, add screenshots or the text of the code (surrounded by triple back ticks) to help explain your problem.
VS Code extension or command-line
Pre 1.1.209
Additional context
Using @Gobot1234's mypy fork with
Self
support this type-checks finereveal_type
outputstest2.Foo*[[email protected]]
Unsure if that's the expected behaviour but if the reference implimentation allows it I suspect pyright should too?
Additional to that,
pyright will dissalow this code as classvars cannot include type-variables, However, the mypy implementation will allow
Self
explicitly, should pyright follow suit?The text was updated successfully, but these errors were encountered: