13 Feb
2015
13 Feb
'15
1:24 a.m.
On 2015-02-13 00:30, Ethan Furman wrote:
On 02/12/2015 04:26 PM, Eric Snow wrote:
On Thu, Feb 12, 2015 at 11:21 AM, Thomas Kluyver
wrote: Or perhaps even a classmethod:
dict.merged(a, b, c)
A dict factory classmethod like this is the best proposal I've seen thus far. * It would be nice if the spelling were more succinct (that's where syntax is helpful). Imagine:
some_func(**dict.merged(a, b, c))
That looks an awful lot like
some_func(**chainmap(a, b, c))
How about making d1 | d2 return an iterator? You could then merge dicts with no intermediate dict: merged = dict(a | b | c) some_func(**a | b | c)