[Tutor] callable objects

Alan Gauld alan.gauld at btinternet.com
Tue Feb 2 10:18:51 CET 2010


"sudhir prasad" <sudheer.kay at gmail.com> wrote

> i run module1 ,first it calls sm1 in module 2 and a list gets updated,now 
> i
> again pass the same list to sm2 in module2 but im getting an error " 
> 'list'
> object is not callable"

That suggests that somewhere in your code you are trying to call the list.
ie putting parentheses after it:

lst = [1,2,3]
lst()   # tryiong to call list but list is "not callable"

So I think the error is to do with a mistake in your copde rather than
the module/submodule structure!

But that is guesswork without seeing the code.
When discussing an error always send the full error message so that
we can read the stack trace etc. And post the code if possible too - at
the very least the function where the error occurs!

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list