Sublassing in C

David M. Cooke cookedm+news at
Sat Aug 14 22:38:33 CEST 2004

At some point, Dennis Kaarsemaker <spamtrap at> 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?

Have a look at Python/exceptions.c in the Python source; that's where
all the subclasses of Exception (IndexError, etc.) are created.

|David M. Cooke

More information about the Python-list mailing list