--- Include/object.h 2005/06/27 21:49:31 1.1 +++ Include/object.h 2005/06/27 21:54:21 @@ -495,6 +495,9 @@ #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0 #endif +/* Set if the builtin type (HEAPTYPE is false) can be altered */ +#define Py_TPFLAGS_MUTABLE_BUILTIN (1L<<17) + #define Py_TPFLAGS_DEFAULT ( \ Py_TPFLAGS_HAVE_GETCHARBUFFER | \ Py_TPFLAGS_HAVE_SEQUENCE_IN | \ --- Objects/typeobject.c 2005/06/27 21:52:06 1.1 +++ Objects/typeobject.c 2005/06/27 21:52:54 @@ -2079,7 +2079,7 @@ static int type_setattro(PyTypeObject *type, PyObject *name, PyObject *value) { - if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { + if (!(type->tp_flags & (Py_TPFLAGS_HEAPTYPE | Py_TPFLAGS_MUTABLE_BUILTIN))) { PyErr_Format( PyExc_TypeError, "can't set attributes of built-in/extension type '%s'",