Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 74356:d64ac9ab4cd0
Implement PEP 380 - 'yield from' (closes #11682)
| author | Nick Coghlan <ncoghlan@gmail.com> |
|---|---|
| date | Fri, 13 Jan 2012 21:43:40 +1000 |
| parents | e1dbc72bd97f |
| children | e1177b9167ce |
line wrap: on
line diff
--- a/Python/compile.c Thu Jan 12 21:10:29 2012 -0500 +++ b/Python/compile.c Fri Jan 13 21:43:40 2012 +1000 @@ -840,6 +840,7 @@ case IMPORT_STAR: return -1; case YIELD_VALUE: + case YIELD_FROM: return 0; case POP_BLOCK: @@ -3318,7 +3319,12 @@ else { ADDOP_O(c, LOAD_CONST, Py_None, consts); } - ADDOP(c, YIELD_VALUE); + if (e->v.Yield.is_from) { + ADDOP(c, YIELD_FROM); + } + else { + ADDOP(c, YIELD_VALUE); + } break; case Compare_kind: return compiler_compare(c, e);
