]> granicus.if.org Git - python/commit
bpo-31671: re: Convert RegexFlag to int before compile (GH-3862)
authorINADA Naoki <methane@users.noreply.github.com>
Thu, 5 Oct 2017 08:19:26 +0000 (17:19 +0900)
committerGitHub <noreply@github.com>
Thu, 5 Oct 2017 08:19:26 +0000 (17:19 +0900)
commitc1c47c166b1012d34f2c6e111ee9ccb5c4d12de7
tree8abd62a2c34b8c1d6c9aa37b0ab47e216162edcf
parentaf810b35b494ef1d255d4bf340b92a9dad446995
bpo-31671: re: Convert RegexFlag to int before compile (GH-3862)

sre_compile does bit test (e.g. `flags & SRE_FLAG_IGNORECASE`) in loop.
`IntFlag.__and__` and `IntFlag.__new__` made it slower.

So this commit convert it to normal int before passing flags to `sre_compile()`.
Doc/whatsnew/3.7.rst
Lib/re.py
Misc/NEWS.d/next/Library/2017-10-04-21-28-44.bpo-31671.E-zfc9.rst [new file with mode: 0644]