On Monday 10 February 2003 21:26, Terry Carroll wrote: > Is there a way to test to see if a variable is defined other than with = the > exception system? > In a recent enough python: def defined(thing): return (thing in locals()) or (thing in globals()) or, old way: def defined(thing): return (locals().has_key(thing)) or (globals().has_key(thing))