Markus Wegmann <[email protected]> added the comment:
Hi Ethan
> Your Enum example in flawless is not an IntEnum, so the error (unable to add
> an integer to None) seems entirely unrelated.
The TypeError is just a consequence of the faulty Enum identity comparison some
lines before. I mentioned the TypeError so you can verify whether your Python
version takes the same program flow.
I also did further research. The Enum's are definitely different regarding the
module path -- the instance comparison will therefore return False. I checked
__module__ + __qualname__:
`flora_tools.radio_configuration.RadioModem.LORA`
vs.
`radio_configuration.RadioModem.LORA`
The cause is the wrong import statement in `flora_tools/codegen/codegen.py`:
`from radio_configuration import RadioConfiguration,\
RADIO_CONFIGURATIONS`
It should have been
`from flora_tools.radio_configuration import RadioConfiguration\
RADIO_CONFIGURATIONS`
The real deal here is why I was allowed to directly import from
`radio_configuration` in the first place. I'm not allowed to directly import a
submodule in the toy project without the proper root module name appended.
Maybe I don't see the big picture, or have some crude options/monkey_patching
enabled.
Nevertheless, the behaviour regarding Enum comparisons and different import
paths seems to me quite misleading.
Best regards
Atokulus
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue30545>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com