diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-13 11:53:15 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-13 11:54:53 +0300 |
commit | 68e7c5146ce24a593889df67d50d8f9c0cfa528e (patch) | |
tree | d671893482a890fcae79dd814a13f2ad5f6ef6d3 /py/objset.c | |
parent | 036ad76659310cd9e2084b67217aa4673562076e (diff) |
py: Factor out impl of special methods for builtin types into opmethods.c
Diffstat (limited to 'py/objset.c')
-rw-r--r-- | py/objset.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/py/objset.c b/py/objset.c index 8ff12ba53..bdc8d7f38 100644 --- a/py/objset.c +++ b/py/objset.c @@ -9,6 +9,7 @@ #include "obj.h" #include "runtime.h" #include "runtime0.h" +#include "builtin.h" typedef struct _mp_obj_set_t { mp_obj_base_t base; @@ -423,13 +424,6 @@ STATIC mp_obj_t set_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { } } -// TODO: Move to common file -STATIC mp_obj_t set_contains(mp_obj_t lhs_in, mp_obj_t rhs_in) { - return set_binary_op(MP_BINARY_OP_IN, lhs_in, rhs_in); -} - -STATIC MP_DEFINE_CONST_FUN_OBJ_2(set_contains_obj, set_contains); - /******************************************************************************/ /* set constructors & public C API */ @@ -452,7 +446,7 @@ STATIC const mp_map_elem_t set_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_symmetric_difference_update), (mp_obj_t)&set_symmetric_difference_update_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_union), (mp_obj_t)&set_union_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_update), (mp_obj_t)&set_update_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR___contains__), (mp_obj_t)&set_contains_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR___contains__), (mp_obj_t)&mp_op_contains_obj }, }; STATIC MP_DEFINE_CONST_DICT(set_locals_dict, set_locals_dict_table); |