[docs] [issue13549] Incorrect nested list comprehension documentation

Ezio Melotti report at bugs.python.org
Sat Dec 10 18:19:47 CET 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

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

----------
Added file: http://bugs.python.org/file23900/issue13549-3.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13549>
_______________________________________


More information about the docs mailing list