Proposal: Generator returning a value should throw SyntaxError

Brendan Eich brendan at
Mon Jan 27 14:47:32 PST 2014

David Herman wrote:
> Finally, task.js is just an example of building a control abstraction out of iterators. It happens that the for-of control flow form is imperative and doesn't have a use for a return value. That doesn't mean other control flow operations won't.

+1. The need for an affordance for some use-cases and lack of need for 
others does not undermine the affordance's value.

PEP-380 is worth a read, IMHO, for anyone who values Python's 
experience. You have to grok some history and custom jargon.


More information about the es-discuss mailing list