[Python-checkins] bpo-32722: Remove useless example in the Classes tutorial (#5446)

Xiang Zhang webhook-mailer at python.org
Thu Feb 1 02:31:11 EST 2018


https://github.com/python/cpython/commit/ab328756d7fd969ee4882458b07892dff135013c
commit: ab328756d7fd969ee4882458b07892dff135013c
branch: master
author: Stéphane Wirtel <stephane at wirtel.be>
committer: Xiang Zhang <angwerzx at 126.com>
date: 2018-02-01T15:31:07+08:00
summary:

bpo-32722: Remove useless example in the Classes tutorial (#5446)

In the tutorial about the Generator expression, there is an example with
a dict comprehension and not with a generator expression, just removed
the code.

files:
A Misc/NEWS.d/next/Documentation/2018-01-30-11-28-27.bpo-32722.frdp6A.rst
M Doc/tutorial/classes.rst

diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index 4676ef4b8a60..b8f1226e54a0 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -892,10 +892,7 @@ Examples::
    >>> sum(x*y for x,y in zip(xvec, yvec))         # dot product
    260
 
-   >>> from math import pi, sin
-   >>> sine_table = {x: sin(x*pi/180) for x in range(0, 91)}
-
-   >>> unique_words = set(word  for line in page  for word in line.split())
+   >>> unique_words = set(word for line in page  for word in line.split())
 
    >>> valedictorian = max((student.gpa, student.name) for student in graduates)
 
diff --git a/Misc/NEWS.d/next/Documentation/2018-01-30-11-28-27.bpo-32722.frdp6A.rst b/Misc/NEWS.d/next/Documentation/2018-01-30-11-28-27.bpo-32722.frdp6A.rst
new file mode 100644
index 000000000000..c4ed27ee2780
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2018-01-30-11-28-27.bpo-32722.frdp6A.rst
@@ -0,0 +1,2 @@
+Remove the bad example in the tutorial of the Generator Expression. Patch by
+Stéphane Wirtel



More information about the Python-checkins mailing list