title: How to inherit from a base class, when the inheriting class requires the inherited class in Python?
body: <p>Given the following requirements:</p>
  <ol>
  <li>We have the classes <code>Foundation</code> and <code>Data</code></li>
  <li><code>Data</code> is a child class of <code>Foundation</code></li>
  <li>Instances of <code>Foundation</code> hold an instance of <code>Data</code></li>
  </ol>
  <p><code>Python</code> code:</p>
  <pre class="lang-py prettyprint-override"><code>from __future__ import annotations
  
  class Foundation():
      data: Data
  
      def __init__(self):
          self.data = Data()
  
  class Data(Foundation):
      pass
  
  Foundation()
  </code></pre>
  <p>However, the given script exits with an <code>RecursionError</code>. Why and how can I implement the three given requirements?</p>