RE strings (was: Variable Interpolation - status of PEP 215)

Tim Peters tim.one at comcast.net
Fri Jun 21 12:18:18 EDT 2002


[unattributed]
> The implementation could choose to cache the result of
> re.compile at module level, thus
>   - speeding up the 'naive' re usage
>   - freeing the programmer from doing the caching in code

[Peter Hansen]
> Any reason the re.match() method could not do the same, internally?

It already does, and always has.  sre increased the internal cache size over
pre, and introduced separate caches for "search" and "replace" uses of
regexp literals.






More information about the Python-list mailing list