|
14 | 14 |
|
15 | 15 | """
|
16 | 16 |
|
| 17 | +__all__ = ["ascii_letters", "ascii_lowercase", "ascii_uppercase", "capwords", |
| 18 | + "digits", "hexdigits", "octdigits", "printable", "punctuation", |
| 19 | + "whitespace", "Formatter", "Template"] |
| 20 | + |
17 | 21 | import _string
|
18 | 22 |
|
19 | 23 | # Some strings for ctype-style character classification
|
@@ -46,7 +50,7 @@ def capwords(s, sep=None):
|
46 | 50 |
|
47 | 51 | ####################################################################
|
48 | 52 | import re as _re
|
49 |
| -from collections import ChainMap |
| 53 | +from collections import ChainMap as _ChainMap |
50 | 54 |
|
51 | 55 | class _TemplateMetaclass(type):
|
52 | 56 | pattern = r"""
|
@@ -104,7 +108,7 @@ def substitute(*args, **kws):
|
104 | 108 | if not args:
|
105 | 109 | mapping = kws
|
106 | 110 | elif kws:
|
107 |
| - mapping = ChainMap(kws, args[0]) |
| 111 | + mapping = _ChainMap(kws, args[0]) |
108 | 112 | else:
|
109 | 113 | mapping = args[0]
|
110 | 114 | # Helper function for .sub()
|
@@ -134,7 +138,7 @@ def safe_substitute(*args, **kws):
|
134 | 138 | if not args:
|
135 | 139 | mapping = kws
|
136 | 140 | elif kws:
|
137 |
| - mapping = ChainMap(kws, args[0]) |
| 141 | + mapping = _ChainMap(kws, args[0]) |
138 | 142 | else:
|
139 | 143 | mapping = args[0]
|
140 | 144 | # Helper function for .sub()
|
|
0 commit comments