Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(31)

Unified Diff: Doc/library/functions.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/ftplib.rst ('k') | Doc/library/gzip.rst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/functions.rst Tue Jul 26 09:37:46 2011 +0300
+++ b/Doc/library/functions.rst Mon Jul 25 09:47:18 2011 -0400
@@ -331,13 +331,14 @@
:term:`iterator`, or some other object which supports iteration. The
:meth:`__next__` method of the iterator returned by :func:`enumerate` returns a
tuple containing a count (from *start* which defaults to 0) and the
- values obtained from iterating over *iterable*.
+ corresponding value obtained from iterating over *iterable*.
- >>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
- >>> list(enumerate(seasons))
- [(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')]
- >>> list(enumerate(seasons, start=1))
- [(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]
+ >>> for i, season in enumerate('Spring Summer Fall Winter'.split(), start=1):
+ print(i, season)
+ 1 Spring
+ 2 Summer
+ 3 Fall
+ 4 Winter
Equivalent to::
« no previous file with comments | « Doc/library/ftplib.rst ('k') | Doc/library/gzip.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+