[docs] Regex howto: revision pass (issue 18562)

ezio.melotti at gmail.com ezio.melotti at gmail.com
Tue Aug 6 08:11:56 CEST 2013


http://bugs.python.org/review/18562/diff/8741/Doc/howto/regex.rst
File Doc/howto/regex.rst (right):

http://bugs.python.org/review/18562/diff/8741/Doc/howto/regex.rst#newcode514
Doc/howto/regex.rst:514: starttagopen = re.compile( ... )
It might be worth expanding a bit on this.
Compiling regex at module-level causes an overhead at import time that
might or might not matter.  The re module also has a cache, so even if
the regex are not compiled manually they get cached (unless the cache is
full and they are removed from there).
Deciding what to do is a judgment call, but mentioning these things
might help taking a decision.

http://bugs.python.org/review/18562/


More information about the docs mailing list