Charles-François Natali added the comment:

> The docs don't even mention that re.compile() actually uses a cache.

Actually it does:
"""
re.compile(pattern, flags=0)

Note The compiled versions of the most recent patterns passed to re.match(), 
re.search() or re.compile() are cached, so programs that use only a few regular 
expressions at a time needn’t worry about compiling regular expressions.
"""

Now, I agree that it's definitely suboptimal...

----------
nosy: +neologix

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to