-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
python/mypy
#18178Description
Hi,
I've been digging into this for a while and unfortunately have not been able to come across the right docs to solve this issue.
"""Kong enum."""
from enum import IntEnum, auto
from typing import List
class Kongs(IntEnum):
"""Kong enum."""
donkey = 0
diddy = auto()
lanky = auto()
tiny = auto()
chunky = auto()
any = auto()
def GetKongs() -> List[Kongs]:
"""Return list of kongs without any."""
return [Kongs.donkey, Kongs.diddy, Kongs.lanky, Kongs.tiny, Kongs.chunky]
Whenever I try to compile this I'm getting the following errors.
build\randomizer\Enums\__native_Kongs.c(78): error C2065: 'CPyStatic_Kongs___donkey': undeclared identifier
build\randomizer\Enums\__native_Kongs.c(78): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
build\randomizer\Enums\__native_Kongs.c(88): error C2065: 'CPyStatic_Kongs___diddy': undeclared identifier
build\randomizer\Enums\__native_Kongs.c(88): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
build\randomizer\Enums\__native_Kongs.c(98): error C2065: 'CPyStatic_Kongs___lanky': undeclared identifier
build\randomizer\Enums\__native_Kongs.c(98): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
build\randomizer\Enums\__native_Kongs.c(108): error C2065: 'CPyStatic_Kongs___tiny': undeclared identifier
build\randomizer\Enums\__native_Kongs.c(108): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
build\randomizer\Enums\__native_Kongs.c(118): error C2065: 'CPyStatic_Kongs___chunky': undeclared identifier
build\randomizer\Enums\__native_Kongs.c(118): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
It only occurs when I have the function defined along with it in the file, if I even move the function outside the file itself and try to compile it in the same set as the enum it then fails.
Am I missing a delayed import of the typing for the enum? Is there a simple way to solve that?
theoallouche and CoreTaxxe
Metadata
Metadata
Assignees
Labels
No labels