[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>
<https://bugs.python.org/issue31671>
_______________________________________


More information about the Python-bugs-list mailing list