Sublassing in C

David M. Cooke cookedm+news at physics.mcmaster.ca
Sat Aug 14 16:38:33 EDT 2004


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

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
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list