[issue24685] collections.OrderedDict collaborative subclassing

Eric Frederich report at bugs.python.org
Thu Jul 23 21:19:57 CEST 2015


Eric Frederich added the comment:

Attached, as inj3.py, is a version I made which seems to work with Python2 but not with Python3's C implementation of OrderedDict.

I had to walk the MRO myself to get the unbound method to pass along as dict_setitem.

With Python3 it doesn't look like doing this was left configurable.
It crashes complaining "TypeError: wrapper __setitem__ doesn't take keyword arguments"

Re-opening this bug since it seems impossible to make OrderedDict cooperative in Python3 even with a wrapper.

Perhaps Python3's OrderedDict should either
(a) be cooperative at the C level
(b) support dict_setitem keyword argument to maintain compatibility with Python2.

----------
resolution: not a bug -> 
status: closed -> open
versions: +Python 3.5
Added file: http://bugs.python.org/file40000/inj3.py

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


More information about the Python-bugs-list mailing list