title: When is an object initialized in a Python constructor expression?
body: <p>Let's say we call a constructor expression:</p>
  
  <pre><code>account2 = Account('John Paul', Decimal('-1234'))
  </code></pre>
  
  <p>The class definition has an initialization method of:</p>
  
  <pre><code>def __init__(self, name, balance):
      if balance &lt; Decimal('0.00'):
          raise ValueError
  
      self.name = name
      self.balance = balance
  </code></pre>
  
  <p>In our constructor expression call the balance is negative and a <code>ValueError</code> is raised by the <code>__init__</code> method.</p>
  
  <p>If I then try to reference the variable <em>account</em> I get a <code>NameError</code> from my REPL.  However, doesn't the class object have to be instantiated for that reference 'self' to be passed into <code>__init__</code> for the initialization method to run in the first place?</p>
  
  <p>I think that Python is reacting correctly, but I'm a tad confused how Python works in the background.</p>
  
  <p><a href="https://i.stack.imgur.com/MkxKx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MkxKx.png" alt="enter image description here"></a></p>