Enable OrderedDict support by default
-
(Hoping this is the right place to suggest this.)
Support for the OrderedDict type was implemented in MicroPython a few years back, as part of the ucollections module. It doesn't seem to be enabled by default on the Pycom firmware versions. (The other data structure provided by this module, namedtuple, is available on Pycom firmware.)
Implementation is already there, see https://github.com/pycom/pycom-micropython/search?q=OrderedDict&type=commits. Enabling by default would involve flipping
MICROPY_PY_COLLECTIONS_ORDEREDDICTto 1 and probably updating tests (official MicroPython repo has some tests which don't seem to appear in the Pycom tree, yet). -
@DvdGiessen If you set up the build environment for pycom-micropython, you can easily add that yourself by adding the following line to esp32/mpconfigport.h:
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) -
Is there a reason why this was left out, besides just saving space?
-
@robert-hh I'm aware, that why I mentioned that flag. I was suggesting it be enabled by default in PyCom's firmware releases. :)
-
@DvdGiessen coming to this several years later. Seems still not enabled in 1.20.2.rc6 firmware because still getting an
ImportErrorwhen runningfrom ucollections import OrderedDict:(
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login