Possible Duplicate:
Python - checking variable existing
Is there an efficient, simple and pythonic way to check if an object exists in the scope?
In Python everything's an object (variables, functions, classes, class instances etc), so I'm looking for a generic existence test for an object, no matter what it is.
I half expected there to be an exists()
built-in function, but I couldn't find any to fit the bill.