[pyar] [OT] - Checkeando parentesis balanceados.
Roberto Alsina
ralsina en netmanagers.com.ar
Vie Jun 18 19:22:15 ART 2010
On Friday 18 June 2010 18:49:15 John Rowland Lenton wrote:
> $ python -m timeit -s 'from q import f_eval, f_re' 'f_re("("*100 +
> ")"*100)' 1000 loops, best of 3: 1.72 msec per loop
> $ python -m timeit -s 'from q import f_eval, f_re' 'f_eval("("*100 +
> ")"*100)'
Si, pero re.compile falla a los 101, vivaracho :-D
>>> re.compile('()'*101)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.6/re.py", line 243, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.6/sre_compile.py", line 517, in compile
"sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups
More information about the pyar
mailing list