Issue 16120: Use |yield from| in stdlib (original) (raw)

Created on 2012-10-03 16:18 by berker.peksag, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
yield-from_v1.diff berker.peksag,2012-10-03 16:18 review
more-yield-from.diff berker.peksag,2012-10-07 20:12 review
Messages (11)
msg171894 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) (Python triager) 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) * (Python committer) Date: 2012-10-06 14:17
Thanks, Berker.
msg172339 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) 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) (Python triager) 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) * (Python committer) 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.
History
Date User Action Args
2022-04-11 14:57:36 admin set github: 60324
2012-10-07 20:31:25 vstinner set nosy: + vstinner
2012-10-07 20:26:27 asvetlov set messages: +
2012-10-07 20:21:25 python-dev set messages: +
2012-10-07 20:12:05 berker.peksag set files: + more-yield-from.diffmessages: +
2012-10-06 14:17:57 asvetlov set status: open -> closedassignee: nobodynosy: + asvetlov, nobodymessages: + resolution: fixedstage: resolved
2012-10-06 14:11:56 python-dev set nosy: + python-devmessages: +
2012-10-04 17:08:52 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2012-10-04 14:28:55 brett.cannon set nosy: + brett.cannonmessages: +
2012-10-03 22🔞46 jcea set messages: +
2012-10-03 16:39:03 r.david.murray set nosy: + r.david.murraymessages: +
2012-10-03 16:25:03 jcea set nosy: + jceamessages: + versions: - Python 3.3
2012-10-03 16🔞18 berker.peksag create