"Patrick Fitzsimmons" wrote: > Hi, > > I'm sure I should know this, but I can't find it in the manual. > > Is there a function in Python like the function in PHP isset()? It > should take a variable name and return True or False depending on > whether the variable is initialized. > > Thanks for any help, > Patrick
There are no unitialized variables in python; if you try to access an undefined name, a NameError exception is raised: try: print "foo is", foo except NameError: print "foo is undefined" To undefine a defined name, use del: >>> foo=None >>> print foo None >>> del foo >>> print foo NameError: name 'foo' is not defined George -- http://mail.python.org/mailman/listinfo/python-list