summaryrefslogtreecommitdiffstatshomepage
path: root/py/objtuple.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-21 13:15:21 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-21 13:20:12 +1100
commit9344e876bb40d2cb759fc8318626952473a4be58 (patch)
tree98ef851a0ff797970d90499992068f3a8f3f7751 /py/objtuple.c
parentd3b2c6e44c25ef6714d767e4da4e808a7ba80f23 (diff)
downloadmicropython-9344e876bb40d2cb759fc8318626952473a4be58.tar.gz
micropython-9344e876bb40d2cb759fc8318626952473a4be58.zip
py/objtype: Allow mp_instance_cast_to_native_base to take native obj.
And rename it to mp_obj_cast_to_native_base() to indicate this. This allows users of this function to easily support native and native-subclass objects in the same way (by just passing the object through this function).
Diffstat (limited to 'py/objtuple.c')
-rw-r--r--py/objtuple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objtuple.c b/py/objtuple.c
index 7df7a3a6e4..e3f37eb77d 100644
--- a/py/objtuple.c
+++ b/py/objtuple.c
@@ -109,7 +109,7 @@ STATIC mp_obj_t tuple_cmp_helper(mp_uint_t op, mp_obj_t self_in, mp_obj_t anothe
mp_obj_tuple_t *self = MP_OBJ_TO_PTR(self_in);
if (another_type->getiter != mp_obj_tuple_getiter) {
// Slow path for user subclasses
- another_in = mp_instance_cast_to_native_base(another_in, MP_OBJ_FROM_PTR(&mp_type_tuple));
+ another_in = mp_obj_cast_to_native_base(another_in, MP_OBJ_FROM_PTR(&mp_type_tuple));
if (another_in == MP_OBJ_NULL) {
return MP_OBJ_NULL;
}