Re: C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
Ahhh... The the light clicks on in my head. I see what is happening and both of these are great approaches. Many thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread André Malo
* [EMAIL PROTECTED] wrote: >> 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. > > Thanks for the reply. I see and was

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
André Malo wrote: > 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. Thanks for the reply. I see and was afraid of that, I

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread André Malo
* [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 uns

C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
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 t