hasattr () vs try-Except-Block, um mit nicht vorhandenen Attributen umzugehen

if hasattr(obj, 'attribute'): # do somthing vs. try: # access obj.attribute except AttributeError, e: # deal with AttributeError Welches sollte bevorzugt werden und warum?