[Python-checkins] r67783 - python/branches/py3k/Doc/howto/functional.rst
georg.brandl
python-checkins at python.org
Mon Dec 15 09:29:32 CET 2008
Author: georg.brandl
Date: Mon Dec 15 09:29:32 2008
New Revision: 67783
Log:
#4668: wrap iterator returns in list() in functional howto.
Modified:
python/branches/py3k/Doc/howto/functional.rst
Modified: python/branches/py3k/Doc/howto/functional.rst
==============================================================================
--- python/branches/py3k/Doc/howto/functional.rst (original)
+++ python/branches/py3k/Doc/howto/functional.rst Mon Dec 15 09:29:32 2008
@@ -634,7 +634,7 @@
... 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 @@
>>> def is_even(x):
... return (x % 2) == 0
- >>> filter(is_even, range(10))
+ >>> list(filter(is_even, range(10)))
[0, 2, 4, 6, 8]
More information about the Python-checkins
mailing list