Serhiy Storchaka added the comment:

Oh, I was aware of this issue for long time, but didn't have good opportunity 
for fixing it. And yes, making PyMapping_Items() (and friends) always returning 
a list looks like a reasonable option to me. This could fix similar bugs in 
third-party extensions. In Python 2 PyMapping_Items() is documented as 
returning a list, but actually it can return an arbitrary type. Authors of 
extensions could be fooled by the documentation and use concrete list API.

The drawback of this solution is some performance degradation in rare case of 
items() returning a tuple.

----------
nosy: +rhettinger, serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31486>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to