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 doerwalter
Recipients doerwalter, r.david.murray, rhettinger, vinay.sajip
Date 2013-01-10.14:36:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 new_child(), new_child() would silently use a normal dict instead:

   class lowerdict(dict):
       def __getitem__(self, key):
           return dict.__getitem__(
               key.lower() if isinstance(key, str) else key
   import collections
   cm = collections.ChainMap(lowerdict(), lowerdict())
   cm2 = cm.new_child(lowerdict())

This would print <class 'dict'>.
Date User Action Args
2013-01-10 14:36:20doerwaltersetrecipients: + doerwalter, rhettinger, vinay.sajip, r.david.murray
2013-01-10 14:36:20doerwaltersetmessageid: <>
2013-01-10 14:36:20doerwalterlinkissue16613 messages
2013-01-10 14:36:19doerwaltercreate