Gareth Rees added the comment:
This is a duplicate of #22180, which was fixed in changeset 9c250f34bfa3 by
Raymond Hettinger in branch '3.4'. The fix just removes the bad example, as in
my patch. So I suggest that this issue be closed as a duplicate.
--
Andrew Svetlov added the comment:
Closed
--
nosy: +asvetlov
resolution: - duplicate
stage: - resolved
superseder: - operator.setitem example no longer works in Python 3 due to
lazy map
___
Python tracker rep...@bugs.python.org
Changes by Benjamin Peterson benja...@python.org:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20606
___
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20606
___
___
New submission from silentbat:
In the Docs for Python3.3
http://docs.python.org/3.3/library/operator.html#operator.__setitem__
the following example doesn't work.
--
assignee: docs@python
components: Documentation
messages: 211079
nosy: docs@python, silent.bat
priority: normal
Gareth Rees added the comment:
The failing example is:
d = {}
keys = range(256)
vals = map(chr, keys)
map(operator.setitem, [d]*len(keys), keys, vals)
which works in Python 2 where map returns a list, but not in Python 3 where map
returns an iterator.
Changes by Gareth Rees g...@garethrees.org:
--
keywords: +patch
Added file: http://bugs.python.org/file34059/operator.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20606
___