In python version 3.13....
I noticed the possibility of creating infinite recursion, that is, the stack does not overflow, this could be attributed to optimizing the "tail" recursion, but memory measurements showed that memory is consumed until it runs out.
Here is the code for reproducing such a recursion:
I noticed the possibility of creating infinite recursion, that is, the stack does not overflow, this could be attributed to optimizing the "tail" recursion, but memory measurements showed that memory is consumed until it runs out.
Here is the code for reproducing such a recursion:
def foo(depth=None): print(foo.count) foo.count += 1 return foo() foo.count = 1 print(foo())It is noteworthy that if you remove the default argument, or run this code on version 3.11..., the stack overflow error will cause
Larz60+ write Apr-19-2025, 04:34 PM:
Please do not make duplicate threads. It is against forum rules.
Please read: Posts to NOT make at all
Have (soft) deleted two threads.
Please do not make duplicate threads. It is against forum rules.
Please read: Posts to NOT make at all
Have (soft) deleted two threads.