[docs] [issue24659] dict() built-in fails on iterators with a "keys" attribute
Martin Panter
report at bugs.python.org
Sat Jul 18 15:06:24 CEST 2015
Martin Panter added the comment:
It is at least an omission from the documentation. The glossary <https://docs.python.org/dev/glossary.html#term-mapping> refers to the Mapping ABC. From Christian’s point of view, the quack of an iterator with just a “keys” attribute sounds more like an iterator than a mapping.
I think the documentation for the dict() constructor should say how to ensure the iterable and mapping modes are triggered. Perhaps dict.update() should also, because it appears to also treat non-dict() “mappings” differently to plain iterators.
----------
nosy: +vadmium
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24659>
_______________________________________
More information about the docs
mailing list