[Python-3000] bytes regular expression?

Victor Stinner victor.stinner at haypocalc.com
Mon Aug 13 02:32:29 CEST 2007


On Thursday 09 August 2007 19:39:50 you wrote:
> 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.

I tried to keep backward compatibility.

Why character string are "optimized" (cached) but not byte string? Since regex 
parsing is slow, it's a good idea to avoid recomputation in re.compile().

Regular expression for bytes are useful for file, network, picture, etc. 
manipulation.

Victor Stinner aka haypo
http://hachoir.org/


More information about the Python-3000 mailing list