Issue #26809: Add __all__ to string module. Patch by Emanuel Barry
diff --git a/Lib/string.py b/Lib/string.py
index 62e8f2f..89287c4 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -14,6 +14,10 @@
"""
+__all__ = ["ascii_letters", "ascii_lowercase", "ascii_uppercase", "capwords",
+ "digits", "hexdigits", "octdigits", "printable", "punctuation",
+ "whitespace", "Formatter", "Template"]
+
import _string
# Some strings for ctype-style character classification
@@ -46,7 +50,7 @@
####################################################################
import re as _re
-from collections import ChainMap
+from collections import ChainMap as _ChainMap
class _TemplateMetaclass(type):
pattern = r"""
@@ -104,7 +108,7 @@
if not args:
mapping = kws
elif kws:
- mapping = ChainMap(kws, args[0])
+ mapping = _ChainMap(kws, args[0])
else:
mapping = args[0]
# Helper function for .sub()
@@ -134,7 +138,7 @@
if not args:
mapping = kws
elif kws:
- mapping = ChainMap(kws, args[0])
+ mapping = _ChainMap(kws, args[0])
else:
mapping = args[0]
# Helper function for .sub()