Commit f7eaf605 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py: Fix "TypeError: 'iterator' object is not iterable", doh.

parent f39d3b93
......@@ -219,6 +219,7 @@ STATIC mp_obj_t array_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t array_it_type = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = array_it_iternext,
};
......
......@@ -107,6 +107,7 @@ mp_obj_t dict_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t mp_type_dict_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = dict_it_iternext,
};
......@@ -336,6 +337,7 @@ STATIC mp_obj_t dict_view_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t dict_view_it_type = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = dict_view_it_iternext,
};
......
......@@ -38,6 +38,7 @@ STATIC mp_obj_t it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t it_type = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = it_iternext
};
......
......@@ -408,6 +408,7 @@ mp_obj_t list_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t mp_type_list_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = list_it_iternext,
};
......
......@@ -63,6 +63,7 @@ STATIC mp_obj_t range_it_iternext(mp_obj_t o_in) {
STATIC const mp_obj_type_t range_it_type = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = range_it_iternext,
};
......
......@@ -72,6 +72,7 @@ STATIC mp_obj_t set_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_
const mp_obj_type_t mp_type_set_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = set_it_iternext,
};
......
......@@ -885,6 +885,7 @@ STATIC mp_obj_t str_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t mp_type_str_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = str_it_iternext,
};
......@@ -903,6 +904,7 @@ STATIC mp_obj_t bytes_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t mp_type_bytes_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = bytes_it_iternext,
};
......
......@@ -251,6 +251,7 @@ STATIC mp_obj_t tuple_it_iternext(mp_obj_t self_in) {
STATIC const mp_obj_type_t mp_type_tuple_it = {
{ &mp_type_type },
.name = MP_QSTR_iterator,
.getiter = mp_identity,
.iternext = tuple_it_iternext,
};
......
i = iter(iter((1, 2, 3)))
print(list(i))
i = iter(iter([1, 2, 3]))
print(list(i))
i = iter(iter({1:2, 3:4, 5:6}))
print(list(i))
i = iter(iter({1, 2, 3}))
print(list(i))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment