msg171894 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2012-10-03 16:18 |
Related changesets: - http://hg.python.org/cpython/rev/33a221662f39 - http://hg.python.org/cpython/rev/fb90e2ff95b7 |
|
|
msg171895 - (view) |
Author: Jesús Cea Avión (jcea) *  |
Date: 2012-10-03 16:25 |
3.3 is in bugfix mode only now. So, targeting 3.4. I am neutral to this change. Showing use of new language idioms is nice, but merging patches to 3.3 and 3.4 would be more difficult. |
|
|
msg171896 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-10-03 16:39 |
Thanks for the patch. I think that seeing as we've already done a bunch, there's little reason not to do more. |
|
|
msg171912 - (view) |
Author: Jesús Cea Avión (jcea) *  |
Date: 2012-10-03 22:18 |
Berker, could you possibly submit a Contributor Agreement Form? Details at http://www.python.org/psf/contrib/ Does your patch take care of all "yield" in the stdlib? |
|
|
msg171954 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2012-10-04 14:28 |
How are people finding these uses? Grepping around for yield and seeing if it is in a 'for' loop? Or are people doing something more detailed like an AST walk of every module in the stdlib looking for some pattern? |
|
|
msg171976 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-10-04 17:08 |
Personally I ran the following command: find -type f -name '*.py' -exec egrep -n -A1 '\bfor\b.*\bin\b' '{}' + | egrep -v 'yield +from' |
egrep -B1 'yield +\w+(, *\w+)* *(# |
$)' I deliberately missed tests and lib2to3, because that's where the changes required more attention. Berker Peksag found a few missed, these changes LGTM. |
msg172197 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-10-06 14:11 |
New changeset 7d8868c13b95 by Andrew Svetlov in branch 'default': Issue [#16120](issue16120 "[closed] Use |yield from |
in stdlib"): Use |
yield from |
msg172198 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-10-06 14:17 |
Thanks, Berker. |
|
|
msg172339 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2012-10-07 20:12 |
> Berker, could you possibly submit a Contributor Agreement Form? > Details at http://www.python.org/psf/contrib/ Jesús, I just emailed the contributor agreement. > Does your patch take care of all "yield" in the stdlib? I found another one -- thanks to Serhiy's command. Patch attached. |
|
|
msg172340 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-10-07 20:21 |
New changeset 70d49694786c by Andrew Svetlov in branch 'default': Issue [#16120](issue16120 "[closed] Use |yield from |
in stdlib"): Use |
yield from |
msg172341 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-10-07 20:26 |
Fixed, thanks. Interesting, I didn't thought «yield from» can be applied to just list, not generator. But it works. |
|
|