I have a recursion function which is finding Eulerian Path. I do not think that the definition of the function is relevant (but if someone thinks so, I will paste it as well
You could use something like:
if __name__ == '__main__': sys.setrecursionlimit(100000) threading.stack_size(200000000) thread = threading.Thread(target=your_code) thread.start()
This solved both my recursion limitation and my heap size limitation.