sys.setrecursionlimit() and regular expressions

Peter Otten __peter__ at web.de
Thu Sep 30 07:35:09 EDT 2010


Santiago Caracol wrote:

> in my program I use recursive functions. A recursion limit of 10 would
> be by far sufficient. Yet, I also use some (not very complicated)
> regular expressions, which only compile if I set the recursion limit
> to 100, or so. This means, of course, an unnecessary loss of speed.

Why do you think so? The recursion limit has no effect on the speed of your 
script. It's just a number that the interpreter checks against.

Peter



More information about the Python-list mailing list