C API - tp_getattro and tp_methods

williams.jasonscott at gmail.com williams.jasonscott at gmail.com
Mon Apr 24 16:22:59 EDT 2006


Hi,

I'm using a tp_getattro function to call into a C library and get
values the the lib keeps track of.  This works:

>>> o = obj.Obj()
>>> o.var
'value'

Thats great but I also want to expose some instance methods and I'm
having trouble.

But when I set tp_methods nothing shows up?  If I unset tp_getattro I
can use my methods.  I'm not understanding the relationship between the
two, tp_methods and tp_getattro.  Could someone point me in the right
direction?

thanks~




More information about the Python-list mailing list