Author: Armin Rigo <[email protected]>
Branch: fix-sre-problems
Changeset: r94153:e0f94dd72f35
Date: 2018-03-28 10:45 +0200
http://bitbucket.org/pypy/pypy/changeset/e0f94dd72f35/
Log: Add comment
diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -388,6 +388,10 @@
srepat.space = space
srepat.w_pattern = w_pattern # the original uncompiled pattern
srepat.flags = flags
+ # note: we assume that the app-level is caching SRE_Pattern objects,
+ # so that we don't need to do it here. Creating new SRE_Pattern
+ # objects all the time would be bad for the JIT, which relies on the
+ # identity of the CompiledPattern() object.
srepat.code = rsre_core.CompiledPattern(code)
srepat.num_groups = groups
srepat.w_groupindex = w_groupindex
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit