[pypy-commit] pypy default: rsre_re.compile can have specialize.memo, it can't be colled with

fijal noreply at buildbot.pypy.org
Mon Nov 26 10:50:17 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r59092:bedee25f8943
Date: 2012-11-26 10:50 +0100
http://bitbucket.org/pypy/pypy/changeset/bedee25f8943/

Log:	rsre_re.compile can have specialize.memo, it can't be colled with
	non-constants anyway

diff --git a/pypy/rlib/rsre/rsre_re.py b/pypy/rlib/rsre/rsre_re.py
--- a/pypy/rlib/rsre/rsre_re.py
+++ b/pypy/rlib/rsre/rsre_re.py
@@ -6,6 +6,7 @@
 from pypy.rlib.rsre import rsre_core, rsre_char
 from pypy.rlib.rsre.test.test_match import get_code as _get_code
 from pypy.module.unicodedata import unicodedb
+from pypy.rlib.objectmodel import specialize
 rsre_char.set_unicode_db(unicodedb)
 
 
@@ -38,6 +39,7 @@
 def split(pattern, string, maxsplit=0):
     return compile(pattern).split(string, maxsplit)
 
+ at specialize.memo()
 def compile(pattern, flags=0):
     code, flags, args = _get_code(pattern, flags, allargs=True)
     return RSREPattern(pattern, code, flags, *args)


More information about the pypy-commit mailing list