title: How do I determine if an object has an attribute in Python?
body: <p>How do I determine if an object has some attribute? For example:</p>
  <pre><code>&gt;&gt;&gt; a = SomeClass()
  &gt;&gt;&gt; a.property
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  AttributeError: SomeClass instance has no attribute 'property'
  </code></pre>
  <p>How do I tell if <code>a</code> has the attribute <code>property</code> before using it?</p>