summaryrefslogtreecommitdiffstatshomepage
path: root/py/objzip.c
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-14 23:58:05 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-14 23:58:05 +0000
commitff8007c7d6497b108e8abe80ab3311945a03fe52 (patch)
treee2f6974d6476cc46b7414ba0626cb519142c3e3d /py/objzip.c
parent9daa78943e58602f74c89a2b5b1ed225f4ccf6cc (diff)
parentc6920d31e2b03205fe2851f74a6a4b48d0165608 (diff)
downloadmicropython-ff8007c7d6497b108e8abe80ab3311945a03fe52.tar.gz
micropython-ff8007c7d6497b108e8abe80ab3311945a03fe52.zip
Merge remote-tracking branch 'upstream/master' into builtins
Diffstat (limited to 'py/objzip.c')
-rw-r--r--py/objzip.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/py/objzip.c b/py/objzip.c
index 2ab80af0b5..a552ff5881 100644
--- a/py/objzip.c
+++ b/py/objzip.c
@@ -12,12 +12,6 @@ typedef struct _mp_obj_zip_t {
mp_obj_t iters[];
} mp_obj_zip_t;
-static mp_obj_t zip_getiter(mp_obj_t self_in) {
- return self_in;
-}
-
-static mp_obj_t zip_iternext(mp_obj_t self_in);
-
static mp_obj_t zip_make_new(mp_obj_t type_in, int n_args, const mp_obj_t *args) {
/* NOTE: args are backwards */
mp_obj_zip_t *o = m_new_obj_var(mp_obj_zip_t, mp_obj_t, n_args);
@@ -29,13 +23,9 @@ static mp_obj_t zip_make_new(mp_obj_t type_in, int n_args, const mp_obj_t *args)
return o;
}
-const mp_obj_type_t zip_type = {
- { &mp_const_type },
- "zip",
- .make_new = zip_make_new,
- .iternext = zip_iternext,
- .getiter = zip_getiter,
-};
+static mp_obj_t zip_getiter(mp_obj_t self_in) {
+ return self_in;
+}
static mp_obj_t zip_iternext(mp_obj_t self_in) {
assert(MP_OBJ_IS_TYPE(self_in, &zip_type));
@@ -57,3 +47,11 @@ static mp_obj_t zip_iternext(mp_obj_t self_in) {
}
return o;
}
+
+const mp_obj_type_t zip_type = {
+ { &mp_const_type },
+ "zip",
+ .make_new = zip_make_new,
+ .getiter = zip_getiter,
+ .iternext = zip_iternext,
+};