[Python-ideas] dict.merge(d1, d2, ...) (Counter proposal for PEP 584)

Steven D'Aprano steve at pearwood.info
Tue Mar 5 05:59:09 EST 2019


On Tue, Mar 05, 2019 at 06:04:40PM +0900, INADA Naoki wrote:
[...]
> One obvious merit of d.merge(...) is it returns same type of d.
> `type(d1)(d1, d2)` looks ugly.
> 
> But people just want dict instead of some subtype of dict.
> This merit is not so important.

Not to me! It *is* important to me.

I want builtins to honour their subclasses. It is probably too late to 
change existing behaviour, but my proposal specifies that subclasses are 
honoured.


-- 
Steven


More information about the Python-ideas mailing list