On 23 November 2017 at 09:17, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > Ivan Levkivskyi wrote: > >> "People sometimes want to refactor for-loops containing `yield` into a >> comprehension >> > > By the way, do we have any real-life examples of people wanting to > do this? It might help us decide what the semantics should be. > > Yes, there are two SO questions in two first posts here, also there are some b.p.o. issues. It looks like in all case people expect: def f(): return [(yield i) for i in range(3)] to be roughly equivalent to def f(): res = [] for i in range(3): r = yield i res.append(r) return res See Serhiy's original post for more detailed proposed semantic equivalence. -- Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171123/2140fcec/attachment.html>
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