]> granicus.if.org Git - python/commitdiff
bpo-32722: Remove useless example in the Classes tutorial (#5446)
authorStéphane Wirtel <stephane@wirtel.be>
Thu, 1 Feb 2018 07:31:07 +0000 (08:31 +0100)
committerXiang Zhang <angwerzx@126.com>
Thu, 1 Feb 2018 07:31:07 +0000 (15:31 +0800)
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.

Doc/tutorial/classes.rst
Misc/NEWS.d/next/Documentation/2018-01-30-11-28-27.bpo-32722.frdp6A.rst [new file with mode: 0644]

index 4676ef4b8a6044c18ec008e22bfccdb4c9a66153..b8f1226e54a01a8d1c69de4a28eb1c92fbbcfa72 100644 (file)
@@ -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 (file)
index 0000000..c4ed27e
--- /dev/null
@@ -0,0 +1,2 @@
+Remove the bad example in the tutorial of the Generator Expression. Patch by
+Stéphane Wirtel