This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients kjwcode, rhettinger
Date 2008-12-05.08:00:16
SpamBayes Score 1.28683e-07
Marked as misclassified No
Message-id <>
In Py3.0, the filter() builtin returns a consumable iterator, not a list.
It's a feature, not a bug ;-)
For the behavior you want, write:
   y = list(filter(odd, x))
Or better yet, use a list comprehension:
   y = [e for e in x if odd(e)]
See the Whatsnew section of the docs for further explanation.
Date User Action Args
2008-12-05 08:00:18rhettingersetrecipients: + rhettinger, kjwcode
2008-12-05 08:00:18rhettingersetmessageid: <>
2008-12-05 08:00:17rhettingerlinkissue4543 messages
2008-12-05 08:00:16rhettingercreate