[docs] Documentation bug report

Alejandro Zazueta alex_zaz at hotmail.com
Sat Apr 13 23:34:41 EDT 2019


In the document name “5. Data Structures”:


                https://docs.python.org/3/tutorial/datastructures.html?highlight=matrix


there is an example with syntax error, in the section:

            5.1.3. List Comprehensions


It seems that the following example:

>>> [x, x**2 for x in range(6)]
  File "<stdin>", line 1, in <module>
    [x, x**2 for x in range(6)]


Is missing the parentheses for the tuple.

The suggested correction is:

>>> [(x, x**2) for x in range(6)]
[(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)]


Hope it helps,
Alex Zazueta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20190414/6bd7734e/attachment.html>


More information about the docs mailing list