Message323432
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 |
|
Date |
User |
Action |
Args |
2018-08-12 06:33:10 | Markus Wegmann | set | recipients:
+ Markus Wegmann, r.david.murray, ethan.furman, adrianwan2, Madhav Datt |
2018-08-12 06:33:10 | Markus Wegmann | set | messageid: <1534055590.55.0.56676864532.issue30545@psf.upfronthosting.co.za> |
2018-08-12 06:33:10 | Markus Wegmann | link | issue30545 messages |
2018-08-12 06:33:10 | Markus Wegmann | create | |
|