We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime-cast-value (TC006)
Found this whilst applying various Ruff groups on typeshed.
According to the updated typing spec for typing enums (see Mypy: Change to Enum Membership Semantics and https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members, this is the recommended way to type an enum in stubs where the type is known but the value isn't:
class Key(enum.Enum): alt = cast(KeyCode, ...) alt_l = cast(KeyCode, ...) alt_r = cast(KeyCode, ...) alt_gr = cast(KeyCode, ...) # ...
This will trigger runtime-cast-value (TC006)
Related: #15132
Ruff: 0.8.4 Command: ruff check --preview --select=TC006 --isolated
0.8.4
ruff check --preview --select=TC006 --isolated
The text was updated successfully, but these errors were encountered:
My bad, some of the other new flake8-type-checking rules I added might also currently be active in stub files. None of them should really be active.
flake8-type-checking
Sorry, something went wrong.
f170932
Successfully merging a pull request may close this issue.
Found this whilst applying various Ruff groups on typeshed.
According to the updated typing spec for typing enums (see Mypy: Change to Enum Membership Semantics and https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members, this is the recommended way to type an enum in stubs where the type is known but the value isn't:
This will trigger
runtime-cast-value (TC006)
Related: #15132
Ruff:
0.8.4
Command:
ruff check --preview --select=TC006 --isolated
The text was updated successfully, but these errors were encountered: