[Python-ideas] PEP: Dict addition and subtraction

Steven D'Aprano steve at pearwood.info
Mon Mar 4 10:25:57 EST 2019

On Mon, Mar 04, 2019 at 10:01:23AM -0500, James Lu wrote:

> If you want to merge it without a KeyError, learn and use the more explicit {**d1, **d2} syntax.

In your previous email, you said the {**d ...} syntax was implicit:

    In other words, explicit + is better than implicit {**, **#, unless 
    explicitly suppressed.  Here + is explicit whereas {**, **} is 
    implicitly allowing inclusive keys, and the KeyError is expressed 
    suppressed by virtue of not using the {**, **} syntax.

It is difficult to take your "explicit/implicit" argument seriously when 
you cannot even decided which is which.


More information about the Python-ideas mailing list