[issue26725] list() destroys map object data

Ned Deily report at bugs.python.org
Sat Apr 9 16:28:54 EDT 2016


Ned Deily added the comment:

This is behaving as expected.  In Python 3, map() returns an iterator, so the first list(x) exhausts that iterator so that the second list(x) returns an empty list.  This is a difference from Python 2 where map() returns a list.  See:

https://docs.python.org/3.5/whatsnew/3.0.html#views-and-iterators-instead-of-lists
https://docs.python.org/3/library/functions.html#map

----------
nosy: +ned.deily
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26725>
_______________________________________


More information about the Python-bugs-list mailing list