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/mpconfig.h | |
| parent | 1004535237e8edc5ec671ab8bea6fd2150139c54 (diff) | |
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/mpconfig.h')
| -rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index aac3ade08..e8f7cc890 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -444,6 +444,11 @@ typedef double mp_float_t; #define MICROPY_PY_COLLECTIONS (1) #endif +// Whether to provide "collections.OrderedDict" type +#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) +#endif + // Whether to provide "math" module #ifndef MICROPY_PY_MATH #define MICROPY_PY_MATH (1) |
