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 coming to this several years later. Seems still not enabled in 1.20.2.rc6 firmware because still getting an
from ucollections import OrderedDict:(
@robert-hh I'm aware, that why I mentioned that flag. I was suggesting it be enabled by default in PyCom's firmware releases. :)
Is there a reason why this was left out, besides just saving space?
robert-hh last edited by
@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)