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 /stmhal | |
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 'stmhal')
-rw-r--r-- | stmhal/mpconfigport.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index c1420da5c0..1d3378739d 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -63,6 +63,7 @@ #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_SYS_EXIT (1) #define MICROPY_PY_SYS_STDFILES (1) +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1) #define MICROPY_PY_CMATH (1) #define MICROPY_PY_IO (1) |