title: Why is the execution of a memory-intensive recursive function suppressed without an error?
body: <p>I have a problem with a function in a file that I am executing. It is expected to produce an <code>IndexError</code>, which it usually does. </p>
  
  <p>However, when <code>N</code> defined as below becomes <em>large enough</em> the error is <strong>not</strong> shown and seems to be suppressed. I would like to know why this is happening. Why isn't some error thrown?</p>
  
  <pre class="lang-py prettyprint-override"><code>from collections import Counter
  from sys import setrecursionlimit
  
  def correct(events: list, lens: list=[]):
  
      counts = Counter(events).values()
      present = []
      while events[0] not in present:
          present.append(events.pop(0))
      lens.append(len(present))
      correct(events, lens)
  
  if __name__ == '__main__':
  
      N = 50000  # enough in my case, increase if the problem does not occur
      setrecursionlimit(10000)
      result = correct([711321] * N)
  </code></pre>
  
  <p>I am executing the file on Windows 10 via PowerShell. After the execution of the file, no output is produced. Nonetheless, its return status <code>$?</code> is <code>False</code>, indicating that there is something wrong with the execution.</p>
  
  <blockquote>
    <p>Note that running this piece of code in a Python shell closes it forcefully.</p>
  </blockquote>