[issue5945] PyMapping_Check returns 1 for lists

Guido van Rossum report at bugs.python.org
Tue Jan 4 20:01:45 CET 2011


Guido van Rossum <guido at python.org> added the comment:

It looks like PyMapping_Check() already checks for the presence of a fairly arbitrary special operation (mp_subscript).  It sounds fine to replace that with a check for the presence of a keys() or items() method (I'm not sure which one is more representative). I wish the check can be done fast -- but I fear that it'll involve a dict lookup.  So be it.

----------

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


More information about the Python-bugs-list mailing list