modifying a non-heaptype dict with PyDict_SetItemString before PyType_Ready should work
from Christian Tismer, he is doing something like this:
int add_more_getsets(PyTypeObject *type, PyGetSetDef *gsp, PyObject **doc_descr)
...
PyObject *dict = type->tp_dict;
...
if (PyDict_SetItemString(dict, gsp->name, descr) < 0)
return -1;
before PyType_Ready
is called on the type. In PyPy this fails with the error can't set attributes on type object
.
We could support this by allowing non-heaptype modifications before a call to PyType_Ready
.