[Python-3000] Bytes and unicode conversion in C extensions

Christian Heimes lists at cheimes.de
Thu Aug 14 23:25:58 CEST 2008


Jesus Cea wrote:
> Current pybsddb code don't allow subclassing or adding new attibutes to
> a given instance. I will (probably) work on this for a future pybsddb
> version. Pointers to references to do this kind of magic welcomed :-)

For making it subclass-able you have to add Py_TPFLAGS_BASETYPE to the 
type flags. In order to make new attributes possible you either need to 
mess around with tp_dict or tp_dictoffset. Grepping for 
_PyObject_GetDictPtr should give you some hints.

Christian


More information about the Python-3000 mailing list