sys.setrecursionlimit() and regular expressions

Santiago Caracol santiago.caracol at
Thu Sep 30 13:53:32 CEST 2010

> 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.

Yes, sorry. I was just about to explain that. The 'of course' in my
post was silly.

In MY program, the recursion limit is relevant for performance,
because I use constructs of the following kind:

def analyze(sentence):
    except RuntimeError:

I.e. I try to apply certain recursive rules to a sentence. If this
doesn't lead to any results (up to recursion limit N),
then I skip the analysis.

More information about the Python-list mailing list