Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> By the way, PyList_SetItem() already has an 
> abstract counterpart called PyObject_SetItem(), 
> so changing this one seems useless.

The problem isn't a lack of available abstract
functions. If some code uses PyObject_SetItem(),
then it already works for both list and dict
subclasses. The issue arises only for code that is 
already using PyDict_SetItem() or PyList_SetItem().

The concrete methods pre-date the abstract methods
and pre-date the ability to subclass built-in types.
Those concrete methods were never updated to reflect
the new reality.  They now only make sense for exact
type matches because they know nothing about 
subclasses and their invariants.


IOW, if some patch is accepted, it needs to be aimed
at the concrete functions to make them subclass aware.

----------

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

Reply via email to