Currently python has a recursion depth of 1000 but i am failing to understand why there is a limit since everything in located on the heap.
Memory management in Python involves a private heap containing all Python objects and data structures. The management of this private heap is ensured internally by the Python memory manager
A common way to avoid stackoverflow is to declare your own stack and use a loop but in this case we are already using the heap.Is it a restriction set by python memory management? .