multidict
multidict copied to clipboard
Implement md.merge(other)
The method should be mimic to md.extend()
but add only keys from other
that are absent in self
.
The behavior is very useful for merging aiohttp session defaults into passed headers for example.
Why not replace existing keys?
Replacing is another useful strategy already implemented by md.update()
.
I'm talking about this case:
- Aiohttp client session has a set of default HTTP headers.
-
client.request()
accepts headers for the concrete request. Default headers should be merged into passed torequest()
one but session defaults should not override formers.
Ok, makes sense