Commits

Maciej Fijalkowski  committed bedee25

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

  • Participants
  • Parent commits 9cd9211

Comments (0)

Files changed (1)

File pypy/rlib/rsre/rsre_re.py

 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)
 
 
 def split(pattern, string, maxsplit=0):
     return compile(pattern).split(string, maxsplit)
 
+@specialize.memo()
 def compile(pattern, flags=0):
     code, flags, args = _get_code(pattern, flags, allargs=True)
     return RSREPattern(pattern, code, flags, *args)