[issue24659] dict() built-in fails on iterators with a "keys" attribute

2015-07-18 Thread Christian Barcenas
Christian Barcenas added the comment: I'm aware of duck typing but I don't think this is the right place for it. (Although ABCs are ostensibly a kind of duck typing, as they do not require implementing classes to inherit from the ABC.) As Martin noticed, the glossary directly

[issue24659] dict() built-in fails on iterators with a "keys" attribute

2015-07-18 Thread Christian Barcenas
Christian Barcenas added the comment: Should have clarified that the specific issue that is outlined in #5945 is that PyMapping_Check returns 1 on sequences (e.g. lists), which would mean something like x = [('one', 1), ('two', 2)]; dict(x) would fail in 3.x because x w

[issue24659] dict() built-in fails on iterators with a "keys" attribute

2015-07-18 Thread Christian Barcenas
New submission from Christian Barcenas: I noticed an inconsistency today between the dict() documentation vs. implementation. The documentation for the dict() built-in [1] states that the function accepts an optional positional argument that is either a mapping object [2] or an iterable

[issue5945] PyMapping_Check returns 1 for lists

2015-07-17 Thread Christian Barcenas
Changes by Christian Barcenas : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue5945> ___ ___ Python-bugs-list mailing list Unsubscribe: