title: When does Python fall back onto class __dict__ from instance __dict__?
body: <p>Please see the below snippet:</p>
  <pre class="lang-py prettyprint-override"><code>class Foo:
      class_var = &quot;hi&quot;
  
  foo = Foo()
  assert foo.class_var is Foo.class_var
  assert &quot;class_var&quot; in Foo.__dict__
  assert &quot;class_var&quot; not in foo.__dict__
  </code></pre>
  <p>All assertions here pass, though I am not sure if it's surprising that the identity assertion passes.</p>
  <p>When and how does Python fall back onto a class <code>__dict__</code> from an instance <code>__dict__</code>?</p>