This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Markus Wegmann
Recipients Madhav Datt, Markus Wegmann, adrianwan2, ethan.furman, r.david.murray
Date 2018-08-12.06:33:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534055590.55.0.56676864532.issue30545@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-08-12 06:33:10Markus Wegmannsetrecipients: + Markus Wegmann, r.david.murray, ethan.furman, adrianwan2, Madhav Datt
2018-08-12 06:33:10Markus Wegmannsetmessageid: <1534055590.55.0.56676864532.issue30545@psf.upfronthosting.co.za>
2018-08-12 06:33:10Markus Wegmannlinkissue30545 messages
2018-08-12 06:33:10Markus Wegmanncreate