]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-152100: Move re compiler optimizations to Lib/re/_optimizer.py (GH-152154)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 25 Jun 2026 08:09:56 +0000 (11:09 +0300)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2026 08:09:56 +0000 (08:09 +0000)
commita00464bc338f19b746f4f7f65a607ad501515f7b
treeeb28da83a9445fe4ce523388d6499a6d6d0374b1
parentbd4bd3e76a684969022c00aafb8acf18006ac89b
gh-152100: Move re compiler optimizations to Lib/re/_optimizer.py (GH-152154)

Move the compile-time optimizations (_optimize_charset, _compile_charset,
_simple, _compile_info and the literal/charset prefix helpers) out of
_compiler.py into a new Lib/re/_optimizer.py.  _compiler.py keeps only the
bytecode emitter and imports them.  This is groundwork for a follow-up
optimization; there is no behavior change.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/re/_compiler.py
Lib/re/_optimizer.py [new file with mode: 0644]
Lib/test/test_re.py