> (yield x*2 for x in foo) > > or maybe: > > (yield: x*2 for x in foo) > > would "yield" better visibility that this is a value that *does* > something (like lambda). Or perhaps without the parentheses, but I > think they're better for clarity, and I'd add them in practice even > if they weren't required. Both look decent to me, and in fact the first is what I was thinking of this morning in the shower. :-) > The main problem with a gencomp syntax is that some people are going > to use it for everything whether they need it or not, even when they > have a small list and the frame overhead for the generator is going > to make it slower. So it almost wants to be a really awkward ugly > thing in order to discourage them... but then again, that way lies > Ruby. :) Actually, that's also Python's philosophy, if you turn it around: only things that can be done efficiently should look cute... --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