mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py: Add iter_buf to getiter type method.
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
This commit is contained in:
@@ -74,7 +74,7 @@ const mp_obj_type_t mp_type_reversed = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_reversed,
|
||||
.make_new = reversed_make_new,
|
||||
.getiter = mp_identity,
|
||||
.getiter = mp_identity_getiter,
|
||||
.iternext = reversed_iternext,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user