Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 13930:4eaa463c031a legacy-trunk
Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since they
did the same anyway.
I'm not sure what to do with Tools/compiler/compiler/* -- that isn't part of
distutils, is it ? Should it try to be compatible with old bytecode version ?
| author | Thomas Wouters <thomas@python.org> |
|---|---|
| date | Fri, 11 Aug 2000 22:15:52 +0000 |
| parents | 8eeaff96b4c2 |
| children | 25fd9846bd54 |
line wrap: on
line diff
--- a/Python/compile.c Fri Aug 11 20:39:29 2000 +0000 +++ b/Python/compile.c Fri Aug 11 22:15:52 2000 +0000 @@ -1729,27 +1729,14 @@ } static void -com_assign_tuple(struct compiling *c, node *n, int assigning) +com_assign_sequence(struct compiling *c, node *n, int assigning) { int i; if (TYPE(n) != testlist) REQ(n, exprlist); if (assigning) { i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_TUPLE, i); - com_push(c, i-1); - } - for (i = 0; i < NCH(n); i += 2) - com_assign(c, CHILD(n, i), assigning); -} - -static void -com_assign_list(struct compiling *c, node *n, int assigning) -{ - int i; - if (assigning) { - i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_LIST, i); + com_addoparg(c, UNPACK_SEQUENCE, i); com_push(c, i-1); } for (i = 0; i < NCH(n); i += 2) @@ -1775,7 +1762,7 @@ case exprlist: case testlist: if (NCH(n) > 1) { - com_assign_tuple(c, n, assigning); + com_assign_sequence(c, n, assigning); return; } n = CHILD(n, 0); @@ -1843,7 +1830,7 @@ "can't assign to []"); return; } - com_assign_list(c, n, assigning); + com_assign_sequence(c, n, assigning); return; case NAME: com_assign_name(c, CHILD(n, 0), assigning); @@ -2869,7 +2856,7 @@ } else { int i = (NCH(n)+1)/2; - com_addoparg(c, UNPACK_TUPLE, i); + com_addoparg(c, UNPACK_SEQUENCE, i); com_push(c, i-1); for (i = 0; i < NCH(n); i += 2) com_fpdef(c, CHILD(n, i));
