2011/11/5 Victor Stinner <victor.stin...@haypocalc.com>: > Hi, > > PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and __setitem__ > for dict subclasses. Is there a reason for that?
It's the same reason that PyUnicode_Concat doesn't call __add__ on unicode subclasses or PyList_Append doesn't call "append" on list subclasses. It's a concrete API. Code which expects subclasses should use PyObject_GetItem and friends, the abstract API. -- Regards, Benjamin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com