Can python have a stack overflow
error?
Recently I was just letting my mind wander when I came across the question: "can python get the stack overflow
error? Does anyone have any answers?
I searched for the answer but only found java answers. I have used java but its just not my question:
My Reasoning
I initially thought no because python just... works most of the time (like passing an int for a string). It also doesn't have stacks (to my knowledge). But I wasn't sure. Here I am.
Sure it can
the following code will cause a seg fault:
import sys
sys.setrecursionlimit(10_000_000)
def foo():
foo()
On Mac OS, this throws:
Segmentation fault: 11
Which is caused by a stack overflow.