aboutsummaryrefslogtreecommitdiff
path: root/Lib/re.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-16 12:38:26 +0200
committerGitHub <noreply@github.com>2017-11-16 12:38:26 +0200
commit05cb728d68a278d11466f9a6c8258d914135c96c (patch)
treeda7fd67bdacf4239d820bcf40cad9f60cab9fb82 /Lib/re.py
parentbpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407) (diff)
downloadcpython-05cb728d68a278d11466f9a6c8258d914135c96c.tar.gz
cpython-05cb728d68a278d11466f9a6c8258d914135c96c.tar.bz2
cpython-05cb728d68a278d11466f9a6c8258d914135c96c.zip
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
Diffstat (limited to 'Lib/re.py')
-rw-r--r--Lib/re.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/re.py b/Lib/re.py
index abbf8d6e290..a8b6753d390 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -251,8 +251,9 @@ def template(pattern, flags=0):
# SPECIAL_CHARS
# closing ')', '}' and ']'
# '-' (a range in character set)
+# '&', '~', (extended character set operations)
# '#' (comment) and WHITESPACE (ignored) in verbose mode
-_special_chars_map = {i: '\\' + chr(i) for i in b'()[]{}?*+-|^$\\.# \t\n\r\v\f'}
+_special_chars_map = {i: '\\' + chr(i) for i in b'()[]{}?*+-|^$\\.&~# \t\n\r\v\f'}
def escape(pattern):
"""