This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients rhettinger, vinay.sajip
Date 2012-12-05.09:13:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354698791.22.0.0978748363163.issue16613@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2012-12-05 09:13:11vinay.sajipsetrecipients: + vinay.sajip, rhettinger
2012-12-05 09:13:11vinay.sajipsetmessageid: <1354698791.22.0.0978748363163.issue16613@psf.upfronthosting.co.za>
2012-12-05 09:13:10vinay.sajiplinkissue16613 messages
2012-12-05 09:13:10vinay.sajipcreate