[pypy-svn] r11637 - pypy/dist/pypy/lib

arigo at codespeak.net arigo at codespeak.net
Fri Apr 29 23:06:57 CEST 2005


Author: arigo
Date: Fri Apr 29 23:06:57 2005
New Revision: 11637

Added:
   pypy/dist/pypy/lib/_re_bak.py
      - copied unchanged from r11618, pypy/dist/pypy/lib/re.py
Removed:
   pypy/dist/pypy/lib/re.py
Log:
Remove (but keep in a corner) our re.py, which is basically the same as the
stdlib's now, but with a missing __all__ attribute.  (Makes test___all__.py
fail)



Deleted: /pypy/dist/pypy/lib/re.py
==============================================================================
--- /pypy/dist/pypy/lib/re.py	Fri Apr 29 23:06:57 2005
+++ (empty file)
@@ -1,43 +0,0 @@
-from sre import *
-
-'''
-# from dumbre import Pattern
-# from plexre import Pattern
-# from sre_adapt import Pattern
-
-
-# Constants, from CPython
-I = IGNORECASE = 2
-L = LOCALE = 4
-M = MULTILINE = 8
-S = DOTALL = 16
-U = UNICODE = 32
-X = VERBOSE = 64
-
-
-# From CPython
-def escape(pattern):
-    "Escape all non-alphanumeric characters in pattern."
-    s = list(pattern)
-    for i in range(len(pattern)):
-        c = pattern[i]
-        if not ("a" <= c <= "z" or "A" <= c <= "Z" or "0" <= c <= "9"):
-            if c == "\000":
-                s[i] = "\\000"
-            else:
-                s[i] = "\\" + c
-    return ''.join(s)
-
-
-_cache = {}
-
-def compile(pattern, flags=0):
-    if (pattern, flags) in _cache:
-        return _cache[pattern, flags]
-    compiled = Pattern(pattern, flags)
-    _cache[pattern, flags] = compiled
-    return compiled
-
-def match(pattern, string, flags=0):
-    return compile(pattern, flags).match(string)
-'''



More information about the Pypy-commit mailing list