yield_all needed in Python
steven.bethard at gmail.com
Wed Mar 2 02:23:44 CET 2005
Douglas Alan wrote:
> In this case, that is great, since I'd much prefer
> yield *gen1(arg)
> yield_all gen1(arg)
I'm guessing the * syntax is pretty unlikely to win Guido's approval.
There have been a number of requests for syntax like:
x, y, *rest = iterable
for unpacking a variable sized list (where *rest would work in an
analogous way to what it does in the args of a def.) Guido has
consistently rejected these proposals, e.g.:
"I think it's not worth adding now, and if you don't hear from me again
on this topic it's because I haven't changed my mind..."
My suspicion is that if he doesn't like the * syntax when there's a
close parallel to the argument parsing usage, he's not likely to like it
when there isn't one.
More information about the Python-list