summaryrefslogtreecommitdiffstats
path: root/Lib/sre.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-02-18 12:05:16 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2001-02-18 12:05:16 (GMT)
commitf2989b22fff921b3394e1709a07f0119370b6d74 (patch)
treee7d820eea66d169e543ac117631694d3afbccbcd /Lib/sre.py
parentae7636753e15273742515eb123999d23f6b7985e (diff)
downloadcpython-f2989b22fff921b3394e1709a07f0119370b6d74.zip
cpython-f2989b22fff921b3394e1709a07f0119370b6d74.tar.gz
cpython-f2989b22fff921b3394e1709a07f0119370b6d74.tar.bz2
- restored 1.5.2 compatibility (sorry, eric)
- removed __all__ cruft from internal modules (sorry, skip) - don't assume ASCII for string escapes (sorry, per)
Diffstat (limited to 'Lib/sre.py')
-rw-r--r--Lib/sre.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/sre.py b/Lib/sre.py
index 061d8e8..48d390a 100644
--- a/Lib/sre.py
+++ b/Lib/sre.py
@@ -17,9 +17,14 @@
import sre_compile
import sre_parse
-__all__ = ["match","search","sub","subn","split","findall","compile",
- "purge","template","escape","I","L","M","S","X","U","IGNORECASE",
- "LOCALE","MULTILINE","DOTALL","VERBOSE","UNICODE","error"]
+# public symbols
+__all__ = [ "match", "search", "sub", "subn", "split", "findall",
+ "compile", "purge", "template", "escape", "I", "L", "M", "S", "X",
+ "U", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
+ "UNICODE", "error" ]
+
+# this module works under 1.5.2 and later. don't use string methods
+import string
# flags
I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case
@@ -88,7 +93,6 @@ def purge():
def template(pattern, flags=0):
"Compile a template pattern, returning a pattern object"
-
return _compile(pattern, flags|T)
def escape(pattern):
@@ -111,7 +115,7 @@ _MAXCACHE = 100
def _join(seq, sep):
# internal: join into string having the same type as sep
- return sep[:0].join(seq)
+ return string.join(seq, sep[:0])
def _compile(*key):
# internal: compile pattern