hasattr()

Tests whether an object has an attribute:

 
>>> import time
>>> hasattr( time, "sleep")
True