title: Relationship between objects and classes in Python 3
body: <p>I thought that I realized this relationship: In Python everything is an object, and every object has a type. But what about classes? A class is a blueprint of an object, and an object is instance of a class. But I have read <a href="http://onlamp.com/pub/a/python/2003/04/17/metaclasses.html" rel="nofollow noreferrer">in an article</a> that in Python, classes are themselves objects. I thought that an object cannot exist without its blueprint - its class. But, if class is an object, how it can exist?</p>
  <pre><code>&gt;&gt;&gt; type.__bases__
  (&lt;class 'object'&gt;,)
  &gt;&gt;&gt; int.__bases__
  (&lt;class 'object'&gt;,)
  &gt;&gt;&gt; str.__bases__
  (&lt;class 'object'&gt;,)
  </code></pre>
  <p>So, the class <code>object</code> is the blueprint of every object?</p>
  <pre><code>&gt;&gt;&gt; type(str)
  &lt;class 'type'&gt;
  &gt;&gt;&gt; type(int)
  &lt;class 'type'&gt;
  &gt;&gt;&gt; type(type)
  &lt;class 'type'&gt;
  </code></pre>
  <p>So, class <code>type</code> is blueprint of every other type?</p>
  <p>But <code>type</code> is an object itself. I cannot understand this. I cannot imagine that classes are objects.</p>