This might not be the best way to go about creating the "out" dict.  Some dict subclasses don't have non-empty constructors--the most common that comes to mind would be `collections.defaultdict`.  If `left` is a `defaultdict`, if the expectation of this function is that a new `defaultdict` is returned there would probably also be an expectation that it have the same default_factory.

Instead why not just `out = deepcopy(left)`?  This should preserve any invariants of the original object but still deep-copy all the values (and the keys for that matter, I think).