[Tutor] recursion
Mats Wichmann
mats at wichmann.us
Mon Aug 15 12:35:08 EDT 2022
On 8/14/22 20:57, avi.e.gross at gmail.com wrote:
> Mats,
>
> I assume you are talking about how recursion to unlimited depths is not a
> great scheme. Does Python support any form of tail recursion?
it doesn't specifically optimize for it, like some languages may do.
and the problem isn't so much infinity (Python has a recursion limit,
and will just kill the program if it goes out of control), as the amount
of duplication if you don't do something clever, which is why time and
memory grows exponentially.
More information about the Tutor
mailing list