On Tue, 6 Jan 2009 15:14:58 -0800 Danek Duvall <[email protected]> wrote:
> On Tue, Jan 06, 2009 at 04:57:02PM -0600, Shawn Walker wrote:
> > From what I understand, the re module has an internal cache that 
> > automatically does this for re.search and re.match.  Hence why re.purge() 
> > exists.
> Huh.  So why bother having a re.compile() at all?

Because the cache is small (used to be one entry, but the module has been 
rewritten a few times since I last looked). If you're going to be using
multiple re's, or calling library code that may use that cache, you're
better off compiling the re and using that.

       <mike
-- 
Mike Meyer <[email protected]>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to