Christian Heimes wrote: > 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.
There's no real reason to do the latter though - none of the builtin Python types permit it since once you make the class subclassable, it's fairly easy for people to add the facility for themselves (as a standard Python class, the subclass gets a __dict__ attribute automatically). Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com