Subclassing in C

Michael Hudson mwh at python.net
Tue Sep 14 13:55:54 CEST 2004


Iker Arizmendi <iker at research.att.com> writes:

> Hello all,
> 
> I've defined a class in a C extension module that is
> (or rather, I would like to be) a subclass of another
> class. I do this by simply setting the tp_base pointer
> of my subclass's type object. However, this results
> in a class that exposes the methods of the base class,
> but ONLY those. The methods of my subclass are hidden.
> I'd obviously like to have the methods of the base
> class AND the new methods of the subclass available.

Are you setting tp_getattro to PyObject_GenericGetAttr? (just a
guess).

Cheers,
mwh

-- 
  <dash> it's like a bicycle
  <dash> but with internet                      -- from Twisted.Quotes



More information about the Python-list mailing list