Author ezio.melotti
Recipients docs@python, eric.araujo, ezio.melotti, mark.dickinson, mattlong, terry.reedy
Date 2011-12-10.17:18:35
SpamBayes Score 4.5701e-08
Marked as misclassified No
Message-id <1323537587.69.0.132665995199.issue13549@psf.upfronthosting.co.za>
In-reply-to
Content
Having both is fine.

I just noticed that the 3.2 docs are different[0], so I tried to merge them:

3.2 says:
"""
List comprehensions provide a concise way to create lists from sequences. Common applications are to make lists where each element is the result of some operations applied to each member of the sequence, or to create a subsequence of those elements that satisfy a certain condition.
"""
I kept this, changing a few minor things.

In 3.2 the examples are divided and each one has a short description.  I reworked them a bit to make them more clear, and added the description inline as a comment.

The section about nested listcomps is the same, so I didn't change it (but it's now a subsection of the list comprehension section).

This is hopefully the final version.

[0]: http://docs.python.org/py3k/tutorial/datastructures.html#list-comprehensions
History
Date User Action Args
2011-12-10 17:19:47ezio.melottisetrecipients: + ezio.melotti, terry.reedy, mark.dickinson, eric.araujo, docs@python, mattlong
2011-12-10 17:19:47ezio.melottisetmessageid: <1323537587.69.0.132665995199.issue13549@psf.upfronthosting.co.za>
2011-12-10 17:18:37ezio.melottilinkissue13549 messages
2011-12-10 17:18:37ezio.melotticreate