PyObject_GetAttr(String) ...

Thomas Wouters thomas at xs4all.net
Wed Jul 5 12:12:44 EDT 2000


On Wed, Jul 05, 2000 at 08:13:51AM -0700, Armin Steinhoff wrote:

> a question for the gurus:

>    what is the difference between the calls
>    
>       - PyObject_GetAttr and
>       - PyObject_GetAttrString ??

> Both have the same 'documented' semantic ... but they are magically
> different.

Actually, no, they aren't the same. PyObject_GetAttrString takes a PyObject
pointer and a char pointer, whereas PyObject_GetAttr takes two PyObject
pointers: the second argument should be a PyString, which is then turned
into a char pointer (using PyString_AS_STRING) and passed to
PyObject_GetAttrString.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list