[Tutor] Type() Getting Type Error

Alan Gauld alan.gauld at btinternet.com
Fri Nov 9 22:42:53 CET 2007


"Chernev Chernev" <chernevik at gmail.com> wrote

> So in the script I write:
> print type([object]
> 
> This bombs, and I get
> "TypeError: 'str' object is not callable'

> In the interactive, 'type([object])' works fine.

Looks like you have defined type as a local variable 
somewhere in your script and this is masking the 
type() function.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list