summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-15 08:29:32 (GMT)
committerGeorg Brandl <georg@python.org>2008-12-15 08:29:32 (GMT)
commita3deea13127f8870f5417cd128de46d161a6f54b (patch)
treecaea48970c5fb2a555a34e169b098a2ae85efb97 /Doc
parentabffe71dc1be222b9b9b203ded10d265ca39ef9d (diff)
downloadcpython-a3deea13127f8870f5417cd128de46d161a6f54b.zip
cpython-a3deea13127f8870f5417cd128de46d161a6f54b.tar.gz
cpython-a3deea13127f8870f5417cd128de46d161a6f54b.tar.bz2
#4668: wrap iterator returns in list() in functional howto.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/howto/functional.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst
index 4dea527..47798e9 100644
--- a/Doc/howto/functional.rst
+++ b/Doc/howto/functional.rst
@@ -634,7 +634,7 @@ features of generator expressions:
... return s.upper()
- >>> map(upper, ['sentence', 'fragment'])
+ >>> list(map(upper, ['sentence', 'fragment']))
['SENTENCE', 'FRAGMENT']
>>> [upper(s) for s in ['sentence', 'fragment']]
['SENTENCE', 'FRAGMENT']
@@ -650,7 +650,7 @@ value.
>>> def is_even(x):
... return (x % 2) == 0
- >>> filter(is_even, range(10))
+ >>> list(filter(is_even, range(10)))
[0, 2, 4, 6, 8]