diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-20 17:41:37 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-20 17:41:37 +0000 |
commit | d1cee02783666338b526ac686c19440c5f44b258 (patch) | |
tree | 19478e31b55312d3167cf8b4281aa6ed01164104 /py/obj.h | |
parent | d48035b06b952b9ac4d95897d08de50d5977bf9f (diff) | |
download | micropython-d1cee02783666338b526ac686c19440c5f44b258.tar.gz micropython-d1cee02783666338b526ac686c19440c5f44b258.zip |
py: Clarify API for map/set lookup when removing&adding at once.
Addresses issue #1160.
Diffstat (limited to 'py/obj.h')
-rw-r--r-- | py/obj.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -159,11 +159,12 @@ typedef struct _mp_map_t { mp_map_elem_t *table; } mp_map_t; -// These can be or'd together +// mp_set_lookup requires these constants to have the values they do typedef enum _mp_map_lookup_kind_t { - MP_MAP_LOOKUP, // 0 - MP_MAP_LOOKUP_ADD_IF_NOT_FOUND, // 1 - MP_MAP_LOOKUP_REMOVE_IF_FOUND, // 2 + MP_MAP_LOOKUP = 0, + MP_MAP_LOOKUP_ADD_IF_NOT_FOUND = 1, + MP_MAP_LOOKUP_REMOVE_IF_FOUND = 2, + MP_MAP_LOOKUP_ADD_IF_NOT_FOUND_OR_REMOVE_IF_FOUND = 3, // only valid for mp_set_lookup } mp_map_lookup_kind_t; extern const mp_map_t mp_const_empty_map; |