From 0ef01d0a75b8b2f48a72f0041e048a390b9e75b6 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 18 Mar 2015 01:25:04 +0200 Subject: 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. --- unix/mpconfigport.h | 1 + 1 file changed, 1 insertion(+) (limited to 'unix') diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index c8ba26897..a7ebf21ed 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -68,6 +68,7 @@ #define MICROPY_PY_SYS_PLATFORM "linux" #define MICROPY_PY_SYS_MAXSIZE (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_FILEIO (1) -- cgit v1.2.3