cpython: 21ae58b77924 (original) (raw)
Mercurial > cpython
changeset 101709:21ae58b77924
Closes #26809: Merge with 3.5 [#26809]
Zachary Ware zachary.ware@gmail.com | |
---|---|
date | Sat, 04 Jun 2016 14:41:42 -0500 |
parents | 780cbe18082e(current diff)8136f9623d7f(diff) |
children | e672cf63d08a |
files | Lib/string.py Misc/NEWS |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-)[+] [-] Lib/string.py 10 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Lib/string.py +++ b/Lib/string.py @@ -14,6 +14,10 @@ printable -- a string containing all ASC """ +all = ["ascii_letters", "ascii_lowercase", "ascii_uppercase", "capwords",
"digits", "hexdigits", "octdigits", "printable", "punctuation",[](#l1.8)
"whitespace", "Formatter", "Template"][](#l1.9)
Some strings for ctype-style character classification
@@ -46,7 +50,7 @@ def capwords(s, sep=None): #################################################################### import re as _re -from collections import ChainMap +from collections import ChainMap as _ChainMap class _TemplateMetaclass(type): pattern = r""" @@ -104,7 +108,7 @@ class Template(metaclass=_TemplateMetacl if not args: mapping = kws elif kws:
mapping = ChainMap(kws, args[0])[](#l1.27)
mapping = _ChainMap(kws, args[0])[](#l1.28) else:[](#l1.29) mapping = args[0][](#l1.30) # Helper function for .sub()[](#l1.31)
@@ -131,7 +135,7 @@ class Template(metaclass=_TemplateMetacl if not args: mapping = kws elif kws:
mapping = ChainMap(kws, args[0])[](#l1.36)
mapping = _ChainMap(kws, args[0])[](#l1.37) else:[](#l1.38) mapping = args[0][](#l1.39) # Helper function for .sub()[](#l1.40)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,8 @@ Core and Builtins
Library
-------
+- Issue #26809: Add __all__
to :mod:string
. Patch by Emanuel Barry.
+