title: How can I describe a Python object, and what is the relationship between attributes, identity, type and value?
body: <p>(In regards to Python 3.2)</p>
  <p>I'm trying to make a statement along the lines of:</p>
  <blockquote>
  <p>In Python, an object is...</p>
  </blockquote>
  <p>According to the doc (<a href="http://docs.python.org/py3k/reference/datamodel.html#objects-values-and-types" rel="nofollow noreferrer">http://docs.python.org/py3k/reference/datamodel.html#objects-values-and-types</a>):</p>
  <blockquote>
  <p>Every object has an identity, a type and a value</p>
  </blockquote>
  <p>But where do attributes fall into that?  If I do something like <code>a = 3; print(a.__class__)</code> I get <code>&lt;class 'int'&gt;</code>  I assume that is the type of the object <code>a</code> references, meaning that &quot;type&quot; is an &quot;attribute&quot; of an object.  So in that sense we can say a sufficient set of &quot;things&quot; an object has would be its identity, value and attributes.  However, looking through the attributes of a using <code>dir(a)</code>, I do not see anything resembling identity (even though I know the <code>id()</code> function will tell me that information).</p>
  <p>So my question is are any of the following minimal statements to sufficiently describe the notion of a Python object?</p>
  <blockquote>
  <ol>
  <li><p>In Python an object has attributes, of which always include an identity, type and value.</p>
  </li>
  <li><p>In Python an object has an identity and attributes, of which always include its type and value.</p>
  </li>
  <li><p>In Python an object has an identity, value and attributes, of which always include its type, among other things.</p>
  </li>
  </ol>
  </blockquote>
  <p>If not, could someone give me a definition that conveys the relationships attributes, identity, type and value for an object?</p>
  <p>(I would prefer number 1 to be true. :P)</p>