Skip to content

ImmutableDict and NamespaceDict convert to subclass type when subclassed, instead of parent type

David Hilton requested to merge dhiltonp/dict-toolbox:Safe-Down into master

Previously, if you created a SafeNamespaceDict with a nested dictionary (like {'foo': {'bar': 1}}, the outer dictionary would be converted to a SafeNamespaceDict, but the inner would be converted to a NamespaceDict.

This changes NamespaceDict and ImmutableDict methods to convert nested dictionaries to the type used for creation of the outer dictionary.

Merge request reports