New submission from Vinay Sajip:

ChainMap.new_child could IMO be improved through allowing an optional dict to 
be passed, which is used to create the child. The use case is that you 
sometimes need to temporarily push a new non-empty mapping in front of an 
existing chain. This could be achieved by changing new_child to the following, 
which is backwards-compatible:

    def new_child(self, d=None):
        'New ChainMap with a new dict followed by all previous maps.'
        return self.__class__(d or {}, *self.maps)

----------
components: Library (Lib)
messages: 176974
nosy: rhettinger, vinay.sajip
priority: normal
severity: normal
status: open
title: ChainMap.new_child could use improvement
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16613>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to