diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-03-18 01:25:04 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-20 17:26:10 +0000 |
commit | 0ef01d0a75b8b2f48a72f0041e048a390b9e75b6 (patch) | |
tree | 2d32b82d34d026ac59b9724ea5323612bc09b67d /py/objmodule.c | |
parent | 1004535237e8edc5ec671ab8bea6fd2150139c54 (diff) | |
download | micropython-0ef01d0a75b8b2f48a72f0041e048a390b9e75b6.tar.gz micropython-0ef01d0a75b8b2f48a72f0041e048a390b9e75b6.zip |
py: Implement core of OrderedDict type.
Given that there's already support for "fixed table" maps, which are
essentially ordered maps, the implementation of OrderedDict just extends
"fixed table" maps by adding an "is ordered" flag and add/remove
operations, and reuses 95% of objdict code, just making methods tolerant
to both dict and OrderedDict.
Some things are missing so far, like CPython-compatible repr and comparison.
OrderedDict is Disabled by default; enabled on unix and stmhal ports.
Diffstat (limited to 'py/objmodule.c')
-rw-r--r-- | py/objmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objmodule.c b/py/objmodule.c index 0e806a7054..02292ff785 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -62,7 +62,7 @@ STATIC void module_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { STATIC bool module_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { mp_obj_module_t *self = self_in; mp_obj_dict_t *dict = self->globals; - if (dict->map.table_is_fixed_array) { + if (dict->map.is_fixed) { #if MICROPY_CAN_OVERRIDE_BUILTINS if (dict == &mp_module_builtins_globals) { if (MP_STATE_VM(mp_module_builtins_override_dict) == NULL) { |