[New-bugs-announce] [issue31671] IntFlag makes re.compile slower

INADA Naoki report at bugs.python.org
Tue Oct 3 07:00:30 EDT 2017

New submission from INADA Naoki <songofacandy at gmail.com>:

flags exposed by re module are IntFlag from Python 3.4.

Since it is passed to underlying sre_parse and sre_compile,
tests in loop (e.g. `flags & SRE_FLAG_IGNORECASE`) calls
IntFlag.__and__ and creates new instance everytime.

It makes re.compile() slower.

components: Library (Lib)
messages: 303594
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: IntFlag makes re.compile slower
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list