Skip to content

How to type a Complex Enum in .pyi file? #5250

Answered by attack68
attack68 asked this question in Questions
Discussion options

You must be logged in to vote

Thanks I needed to extend this to:

class MyEnum:
    class A(MyEnum):
        val: int
        def __init__(self, val: int) -> None: ...
    
    class B(MyEnum):
        name: str
        def __init__(self, name: str) -> None: ...

But this did indeed solve many mypy errors.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@attack68
Comment options

Answer selected by attack68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants