4 May
2004
4 May
'04
8:17 p.m.
On Tue, May 04, 2004 at 12:46:08PM -0700, Sam Gendler wrote:
How does one check the type of a variable in a python script? I get a global name error when I try to use the type method.
yep, it's one of the builtins that are forbidden in TTW code for murky security reasons. The "same_type" function is available for that purpose. if same_type(foo, ''): # it's a string elif same_type(foo, 1): # ... you get the idea -- Paul Winkler http://www.slinkp.com