[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___ ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can you write-up a patch with tests and a doc change? -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- hgrepos: +171 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___ ___ Python-bugs-list

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- keywords: +patch Added file: http://bugs.python.org/file28694/951243de359a.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Vinay Sajip
Vinay Sajip added the comment: Can you write-up a patch with tests and a doc change? Done. -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Put a *versionchanged* tag in the doc entry and this is ready to apply. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: rhettinger - vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also, please change the variable name from *amap* to either *m* or *mapping*. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2013-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset c0ddae67f4df by Vinay Sajip in branch 'default': Closes #16613: Added optional mapping argument to ChainMap.new_child. http://hg.python.org/cpython/rev/c0ddae67f4df -- nosy: +python-dev resolution: - fixed stage: patch review -

[issue16613] ChainMap.new_child could use improvement

2013-01-10 Thread Walter Dörwald
Walter Dörwald added the comment: I'd like to have this feature too. However the code should use d if d is not None else {} instead of d or {} For example I might want to use a subclass of dict (lowerdict) that converts all keys to lowercase. When I use an empty lowerdict in

[issue16613] ChainMap.new_child could use improvement

2013-01-10 Thread Vinay Sajip
Vinay Sajip added the comment: d if d is not None else {} Your intention makes sense, though I would prefer to write it as: if d is None: d = {} return self.__class__(d, *self.maps) -- ___ Python tracker rep...@bugs.python.org

[issue16613] ChainMap.new_child could use improvement

2013-01-07 Thread R. David Murray
R. David Murray added the comment: I agree that this would be useful. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16613 ___

[issue16613] ChainMap.new_child could use improvement

2012-12-05 Thread Vinay Sajip
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