On Nov 6, 2011, at 1:26 PM, Martin v. Löwis wrote:
> Am 06.11.2011 17:39, schrieb Antoine Pitrou:
>> Le 05/11/2011 17:34, Éric Araujo a écrit :
>>> Hi Victor,
>>>
PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and
__setitem__
for dict subclasses. Is there a reason fo
Am 06.11.2011 17:39, schrieb Antoine Pitrou:
> Le 05/11/2011 17:34, Éric Araujo a écrit :
>> Hi Victor,
>>
>>> PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and
>>> __setitem__
>>> for dict subclasses. Is there a reason for that?
>>
>> http://bugs.python.org/issue10977 “Currently, th
Le 05/11/2011 17:34, Éric Araujo a écrit :
Hi Victor,
PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and __setitem__
for dict subclasses. Is there a reason for that?
http://bugs.python.org/issue10977 “Currently, the concrete object C API
bypasses any methods defined on subclasse
Hi Victor,
> PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and __setitem__
> for dict subclasses. Is there a reason for that?
http://bugs.python.org/issue10977 “Currently, the concrete object C API
bypasses any methods defined on subclasses of builtin types.”
Cheers
_
2011/11/5 Victor Stinner :
> 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
Hi,
PyDict_GetItem() and PyDict_SetItem() don't call __getitem__ and __setitem__
for dict subclasses. Is there a reason for that?
I found this surprising behaviour when I replaced a dict by a custom dict
checking the key type on set. But my __setitem__ was not called because the
function using