'int' object is not callable

JW jkpangtang at yahoo.com
Wed Jul 23 02:46:38 CEST 2003


Hi,

Suppose I have the following python method:

def foo(aTuple):
	print len(aTuple)  #line 1
	print aTuple[0]    # line 2
	return 0



Then, suppose I call that python method from within a C function
using:  PyObject_CallObject(pFunc, pArgTuple);


I get the following error at line 1:
	'int' object is not callable

If i remove line 1, then my foo() method does print out correct value for aTuple[0].

Why am I getting this error when i try using python len() built-in function?

Thanks




More information about the Python-list mailing list