[Python-Dev] PyDict_Get/SetItem and dict subclasses
Benjamin Peterson
benjamin at python.org
Sat Nov 5 17:34:47 CET 2011
More information about the Python-Dev mailing list
Sat Nov 5 17:34:47 CET 2011
- Previous message: [Python-Dev] PyDict_Get/SetItem and dict subclasses
- Next message: [Python-Dev] PyDict_Get/SetItem and dict subclasses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2011/11/5 Victor Stinner <victor.stinner at 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
- Previous message: [Python-Dev] PyDict_Get/SetItem and dict subclasses
- Next message: [Python-Dev] PyDict_Get/SetItem and dict subclasses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list