summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/obj.c b/py/obj.c
index dd081ee35e..7dd9cc0a24 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -288,3 +288,9 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) {
}
return MP_OBJ_NEW_SMALL_INT(len);
}
+
+// Return input argument. Useful as .getiter for objects which are
+// their own iterators, etc.
+mp_obj_t mp_identity(mp_obj_t self) {
+ return self;
+}