A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-March/052059.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())Jim Jewett jimjjewett at gmail.com
Fri Mar 11 20:03:17 CET 2005
Barry:

> Ping's suggested list comprehension abbreviation, i.e.:

>    [x in seq if x] == [x for x in seq if x]

> might help.

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.
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