mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #11297: Add collections.ChainMap()
This commit is contained in:
parent
692f038a5d
commit
9fe1ccfb5a
6 changed files with 123 additions and 7 deletions
|
@ -46,7 +46,7 @@ def capwords(s, sep=None):
|
|||
|
||||
####################################################################
|
||||
import re as _re
|
||||
from collections import _ChainMap
|
||||
from collections import ChainMap
|
||||
|
||||
class _TemplateMetaclass(type):
|
||||
pattern = r"""
|
||||
|
@ -100,7 +100,7 @@ class Template(metaclass=_TemplateMetaclass):
|
|||
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()
|
||||
|
@ -126,7 +126,7 @@ class Template(metaclass=_TemplateMetaclass):
|
|||
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue