[Python-checkins] cpython (merge 3.6 -> default): Merge 3.6

victor.stinner python-checkins at python.org
Mon Nov 7 18:46:28 EST 2016


https://hg.python.org/cpython/rev/90e5aa508a89
changeset:   104962:90e5aa508a89
parent:      104960:983a8887a895
parent:      104961:d903a243c281
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Nov 08 00:44:53 2016 +0100
summary:
  Merge 3.6

files:
  Lib/re.py |  33 ++++++++++++---------------------
  1 files changed, 12 insertions(+), 21 deletions(-)


diff --git a/Lib/re.py b/Lib/re.py
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -119,7 +119,6 @@
 
 """
 
-import enum
 import sre_compile
 import sre_parse
 import functools
@@ -139,26 +138,18 @@
 
 __version__ = "2.2.1"
 
-class RegexFlag(enum.IntFlag):
-    ASCII = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
-    IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case
-    LOCALE = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
-    UNICODE = sre_compile.SRE_FLAG_UNICODE # assume unicode "locale"
-    MULTILINE = sre_compile.SRE_FLAG_MULTILINE # make anchors look for newline
-    DOTALL = sre_compile.SRE_FLAG_DOTALL # make dot match newline
-    VERBOSE = sre_compile.SRE_FLAG_VERBOSE # ignore whitespace and comments
-    A = ASCII
-    I = IGNORECASE
-    L = LOCALE
-    U = UNICODE
-    M = MULTILINE
-    S = DOTALL
-    X = VERBOSE
-    # sre extensions (experimental, don't rely on these)
-    TEMPLATE = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
-    T = TEMPLATE
-    DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation
-globals().update(RegexFlag.__members__)
+# flags
+A = ASCII = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
+I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case
+L = LOCALE = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
+U = UNICODE = sre_compile.SRE_FLAG_UNICODE # assume unicode "locale"
+M = MULTILINE = sre_compile.SRE_FLAG_MULTILINE # make anchors look for newline
+S = DOTALL = sre_compile.SRE_FLAG_DOTALL # make dot match newline
+X = VERBOSE = sre_compile.SRE_FLAG_VERBOSE # ignore whitespace and comments
+
+# sre extensions (experimental, don't rely on these)
+T = TEMPLATE = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
+DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation
 
 # sre exception
 error = sre_compile.error

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list