We already have yield expressions and they mean something else... On Sat, Feb 7, 2009 at 1:04 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > Guido van Rossum wrote: > >> It would be way too confusing to have "a different form of call" with >> totally different semantics that nevertheless used the same >> *terminology* as is used for regular calls. > > I expect you're right, so I won't argue for calling > it "call" any more. > > I'd still like to find a good name for it, though. > The other important thing is that my proposed construct > should be usable as an expression, and its value > should be whatever is returned by the called generator > when it exits. E.g. if we continue spelling it > "yield *" for the moment, then > > def f(): > v = yield *g() > print v > > def g(): > yield 42 > return "spam" > > for x in f(): > pass > > should end up printing "spam". > > Would you entertain the idea of a "yield *" expression > with those semantics? > > -- > Greg > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/guido%40python.org > -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4