
1 Mar
2019
1 Mar
'19
1:29 a.m.
28.02.19 23:19, Greg Ewing пише:
Serhiy Storchaka wrote:
I do not understand why we discuss a new syntax for dict merging if we already have a syntax for dict merging: {**d1, **d2} (which works with *all* mappings).
But that always returns a dict. A '+' operator could be implemented by other mapping types to return a mapping of the same type.
And this opens a non-easy problem: how to create a mapping of the same type? Not all mappings, and even not all dict subclasses have a copying constructor.