if hasattr(obj, \'attribute\'): # do somthing
vs
try: # access obj.attribute except AttributeError, e: # deal with Attr
I'd suggest option 2. Option 1 has a race condition if some other thread is adding or removing the attribute.
Also python has an Idiom, that EAFP ('easier to ask forgiveness than permission') is better than LBYL ('look before you leap').