Like update, but merges sub-dicts instead of clobbering at the top level. Updates d1 in-place
(d1, d2)
| 39 | return False |
| 40 | |
| 41 | def _merge(d1, d2): |
| 42 | """Like update, but merges sub-dicts instead of clobbering at the top level. |
| 43 | |
| 44 | Updates d1 in-place |
| 45 | """ |
| 46 | |
| 47 | if not isinstance(d2, dict) or not isinstance(d1, dict): |
| 48 | return d2 |
| 49 | for key, value in d2.items(): |
| 50 | d1[key] = _merge(d1.get(key), value) |
| 51 | return d1 |
| 52 | |
| 53 | def _display_mimetype(mimetype, objs, raw=False, metadata=None): |
| 54 | """internal implementation of all display_foo methods |