On Sat, 14 Aug 2004 15:31:26 +0200, Dennis Kaarsemaker
<sp******@kaarsemaker.net> wrote:
I'm trying to create a subclass of Exception in C, but cant figure out
what to use as tp_base in the PyTypeObject struct. Can anybody give me
directions on where to look or maybe even an answer?
Currently, exceptions have to be old-style classes, so you cannot create a
subclass using the new type-based subclassing. Instead, you should use
PyErr_NewException, which creates a new Exception subclass with the given name,
base and attributes (despite the first sentence of the documentation, it returns
a new subclass, not a new exception object).
---
Greg Chapman