[issue1475692] replacing obj.__dict__ with a subclass of dict

Kushal Das report at bugs.python.org
Mon Apr 29 20:26:23 CEST 2013


Kushal Das added the comment:

In Objects/typeobject.c we have subtype_setdict function, in which at line 1830 we have PyDict_Check() macro call, which checks if it is a subclass of dict or not.

The definition is in Include/dictobject.h

#define PyDict_Check(op) \
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)

We can stop assigning anything other than dict in typesobject.c but that will break other things like http://bugs.python.org/issue1475692

----------
nosy: +kushaldas

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


More information about the Python-bugs-list mailing list