|
|
|
|
|
by echohack
4327 days ago
|
|
...and I'm surprised there's a whole section on using recursion in Python, considering Python guards against recursion depth. (tail recursion is especially applicable here). The author seems to have a solid understanding of Python, so I'm a little confused. In general, if you use recursion in python, you're gonna have a bad time. Better to use an iterator (which is usually more memory efficient anyway because you're not slurping up the whole thing...). Of course, you can always hack it and sys.setrecursionlimit, but WHY WOULD YOU DO THIS. https://docs.python.org/2/library/sys.html#sys.setrecursionl... |
|