[Python-3000] bytes regular expression?

Steven Bethard steven.bethard at gmail.com
Thu Aug 9 19:39:50 CEST 2007


On 8/9/07, Victor Stinner <victor.stinner at haypocalc.com> wrote:
> re module uses a dictionary to store compiled expressions and the key is a
> tuple (pattern, flags) where pattern is a bytes (str8) or str and flags is an
> int.

So why not just skip caching for anything that doesn't hash()?  If
you're really worried about efficiency, simply re.compile() the
expression once and don't rely on the re module's internal cache.

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy


More information about the Python-3000 mailing list