-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
Manage inheritance correctly #4
Comments
Actually, maybe inheriting from other TypeEnums also shouldn't be allowed because this will mess up the exhaustiveness check. |
It should work like this: You can do inheritance but the inner types of a subclass are not members of the base class. So, |
There is another point: |
Note also, that if we have class Color(TypeEnum):
rgb = (int, int, int)
class BgColor(Color):
hsv = (int, int, int) then assert not issubclass(BgColor, Color) which is admittedly a bit weird... but otherwise |
Only Generic and other TypeEnums should be allowed. See how it's done with TypedDict: https://github.com/python/cpython/blob/32220543e2db36c6146ff2704ed1714a6adecc1b/Lib/typing.py#L2931
The text was updated successfully, but these errors were encountered: