Message82391
FYI, I was able to work around this and use an unmodified Python by
subtyping type and overriding the setattr method as shown below. It's a
lot messier than patching Python.
static int
Mutable_SetAttr(PyObject *obj, PyObject *name, PyObject *value)
{
// Can't just call PyObject_GenericSetAttr because
// we need to able to update the __str__ slot as well.
PyTypeObject *type = reinterpret_cast<PyTypeObject*>(obj);
type->tp_flags |= Py_TPFLAGS_HEAPTYPE;
int result = PyType_Type.tp_setattro(obj, name, value);
type->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
return result;
} |
|
Date |
User |
Action |
Args |
2009-02-18 00:04:29 | gregcouch | set | recipients:
+ gregcouch, loewis |
2009-02-18 00:04:28 | gregcouch | set | messageid: <1234915468.96.0.615090620382.issue1229239@psf.upfronthosting.co.za> |
2009-02-18 00:04:27 | gregcouch | link | issue1229239 messages |
2009-02-18 00:04:26 | gregcouch | create | |
|