[Python-Dev] Time for 2.3.3?

Tim Peters tim.one at comcast.net
Fri Nov 21 14:22:18 EST 2003


[Barry Warsaw]
> Is it possible that USE_RECURSION_LIMIT isn't defined for my RH
> builds?!

I can't see how:  it's set by a giant maze of #ifdef's, which are almost as
reliable as a giant maze of CVS branches <wink>.

Because the #ifdef's nest 4 deep at one point, and the bodies aren't
indented, it's damned hard to figure out what they're doing by eyeball.  But
I *think* this part:

"""

#else
#define USE_RECURSION_LIMIT 10000
#endif
#endif
#endif
"""

which gives all the appearance of defining a default value (if nothing else
triggers), is actually nested *inside* an

    #elif defined(__FreeBSD__)

block (which is in turn nested in a !defined(USE_STACKCHECK) block, which is
in turn nested in an ifndef SRE_RECURSIVE block).  God only knows what the
intent was.  But I expect that, yes, USE_RECURSION_LIMIT isn't getting
defined on anything other than FreeBSD and Win64.

> I added the attached little bit of (seemingly useful) code
> to _sre.c, recompiled and then...
>
> % ./python
> Python 2.3.3a0 (#4, Nov 21 2003, 13:39:39)
> [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import _sre
> [24546 refs]
> >>> _sre.RECURSION_LIMIT
> [24546 refs]
> >>>
> [24546 refs]
> [7129 refs]
>
> Very odd.

OTOH, if you believe what it says, that leads directly to the cause <wink>.




More information about the Python-Dev mailing list