* [EMAIL PROTECTED] wrote:

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

> 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?

tp_getattro is like defining __getattribute__, i.e. it gets called on every
attribute read access. You can use PyObject_GenericGetAttr inside the
function to find predefined attributes before applying your own rules.

nd
-- 
"Die Untergeschosse der Sempergalerie bleiben währenddessen aus
 statistischen Gründen geflutet." -- Spiegel Online
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to