[issue46376] PyMapping_Check returns 1 for list
Bar Harel
report at bugs.python.org
Fri Jan 14 23:01:14 EST 2022
Bar Harel <bzvi7919 at gmail.com> added the comment:
Another question we should ask is about duck typing. Is a sequence which doesn't inherit from abc.Sequence considered a sequence? Whatever the answer is, PySequence specifically looks for a sequence and removes duck typing out of the picture. The object will not pass static typing and will not pass isinstance check, so there's no reason for it to pass PySequence.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46376>
_______________________________________
More information about the Python-bugs-list
mailing list