faqts : Computers : Programming : Languages : Python : Language and Syntax

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 8 people (50%) answered Yes
Recently 3 of 5 people (60%) answered Yes

Entry

What is the difference between the calls PyObject_GetAttr and PyObject_GetAttrString?

Jul 12th, 2000 00:55
unknown unknown, Thomas Wouters


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.