A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-March/052074.html below:

[Python-Dev] comprehension abbreviation (was: Adding any() and all())

[Python-Dev] comprehension abbreviation (was: Adding any() and all()) [Python-Dev] comprehension abbreviation (was: Adding any() and all())Nick Coghlan ncoghlan at iinet.net.au
Sat Mar 12 01:43:48 CET 2005
Jim Jewett wrote:
> Note that the last x shouldn't have to be x.
> 
>     [x in seq if f(x)] 
> 
> is by far my most common syntax error, and 
> 
>     [x for x in seq if f(x)]
> 
> is always what I want instead.

That 'x in seq' bit still shouts "containment" to me rather than iteration, though.

Perhaps repurposing 'from':

   (x from seq if f(x))

That rather breaks TOOWTDI though (since it is essentially new syntax for a for 
loop). And I have other hopes for the meaning of (x from ()). . .

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net
More information about the Python-Dev mailing list

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