Replies: 1 comment
-
I'm not aware of any tools that would detect this statically. From a type analysis standpoint, there is no type violation here, so it shouldn't be surprising that neither pyright nor mypy generate an error here. Perhaps there are linter rules that would help you catch such errors? |
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
-
Hi,
I have an issue with StrEnum. pyright does not find any error in this simple code:
This is because Fruit init method is typed like this:
class Fruit(value: str)
So I wonder if pyright could/should catch those errors?
If not, what are good alternatives to python enums for catching those errors before runtime?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions