A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-January/059653.html below:

[Python-Dev] Limiting the recursion limit

[Python-Dev] Limiting the recursion limit [Python-Dev] Limiting the recursion limitGuido van Rossum guido at python.org
Wed Jan 11 18:34:28 CET 2006
On 1/11/06, skip at pobox.com <skip at pobox.com> wrote:
>
>     >>> sys.setrecursionlimit(1<<30)
>     >>> f = lambda f:f(f)
>     >>> f(f)
>     Segmentation fault
>
> Is there some way that Python can determine that 1<<30 is an unreasonable
> recursion limit?

Yes, but that doesn't help -- there's some value in the middle where
you may or may not get a crash depending on random other stuff that is
going on, and the only way to know is to try. It's easy enough to code
a loop that tries higher and higher values until it finds a crash.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4