Can't use len() on returned PyList object?

sessile at in-gen.net sessile at in-gen.net
Tue Nov 9 13:16:39 EST 1999


My thanks to those who responded.  You were correct.  I had
assigned 'len' as a variable elsewhere in the program.  I quite
foolishly did this by too closely emulating the C source that
my Python program is going to replace.  Doh!

Thanks again.

At 02:30 PM 11/9/1999 +1100, you wrote:
>On Mon, Nov 08, 1999 at 09:12:17PM -0500, sessile at in-gen.net wrote:
>> Why can't I use 'len()' to find the length of a list
>> returned from my new extension module?  The error is
>> shown as:
>> 
>>     TypeError: call of non-function (type int)
>
>You have probably used 'len' as an integer variable at some point
>previously in the program. This would have overwritten the builtin
>declaration of len as a function.





More information about the Python-list mailing list