Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76291 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2014-08-14 20:02 +1000 |
| Last post | 2014-08-14 20:02 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'? Chris Angelico <rosuav@gmail.com> - 2014-08-14 20:02 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-08-14 20:02 +1000 |
| Subject | Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'? |
| Message-ID | <mailman.12991.1408010569.18130.python-list@python.org> |
On Thu, Aug 14, 2014 at 7:59 PM, Makoto Kuwata <kwatch@gmail.com> wrote: > I understand that 'val = yield from xs' is completely different from:: > > for x in xs: > ret = yield x > val = x > > Return value is propagated by StopIteration, like: > > it = iter(xs) > try: > while 1: > yield next(it) > except StopIteration as ex: > val = ex.value It's even more complicated than that. The PEP specifies the exact semantics. ChrisA
Back to top | Article view | comp.lang.python
csiph-web