title: What are Python's type "objects" exactly?
body: <p>I'm just beginning to learn Python. I'm finding the type system a little hard to understand. I have a number of questions, but primarily and to cut a long story short; The <a href="https://docs.python.org/3/reference/datamodel.html#data-model" rel="noreferrer">documentation</a> states:</p>
  
  <blockquote>
    <p>"All data in a Python program is represented by objects ... Every
    object has an identity, a type and a value."</p>
  </blockquote>
  
  <p>No problem. But beyond that its not really described what "objects" <em>are</em>. For example the docs don't even cover that these "objects" support a dot operator - from my PoV they could be some in memory data structure not exposed to the user beyond <code>id()</code>, <code>type()</code> etc. However I gather there is some underlying meta object interface similar to that described for the <a href="https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy" rel="noreferrer">class instance</a> type object in the docs. To work from an example:</p>
  
  <p>If I do this on a class instance "x":</p>
  
  <pre><code>x.__class__.__name__
  </code></pre>
  
  <p>I get the name of its class. I understand that. The documentation describes the <code>__class__</code> and <code>__name__</code> properties of <em>class instances</em> and <em>class</em> type objects. If I do this <code>[].__class__.__name__</code> I get "list". Similarly <code>int(1).__class__.__name__</code> gives "int". Its ambiguous to me exactly what is going on under the hood, and I would like clarification. So my questions are:</p>
  
  <ul>
  <li>Whats the relationship between a <em>type</em> type "objects" and "class instances" type objects?</li>
  <li>Can I assume the ~meta API to in-built type objects is the same as that of "class instance" type objects?</li>
  <li>If so, what is this interface and where is it documented?</li>
  <li>In general, what <em>are</em> "objects" that correspond to built-in types, and how are they implemented?</li>
  </ul>