Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python 3.3 fixes this with the "yield from" keyword:

http://docs.python.org/3.3/whatsnew/3.3.html#pep-380

If Javascript did the same thing, you would write yield from second_sound(); in hour_sound, and then you could run hour_sound as a generator and it would Just Work.



ES6 does the same thing with the `yield*` syntax.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: