[Python-ideas] PEP: Dict addition and subtraction

INADA Naoki songofacandy at gmail.com
Tue Mar 5 02:03:11 EST 2019


On Tue, Mar 5, 2019 at 12:02 AM Stefan Behnel <stefan_ml at behnel.de> wrote:
>
> INADA Naoki schrieb am 04.03.19 um 11:15:
> > Why statement is not enough?
>
> I'm not sure I understand why you're asking this, but a statement is "not
> enough" because it's a statement and not an expression. It does not replace
> the convenience of an expression.
>
> Stefan
>

It seems tautology and say nothing.
What is "convenience of an expression"?
Is it needed to make Python more readable language?

Anyway, If "there is expression" is the main reason for this proposal, symbolic
operator is not necessary.
`new = d1.updated(d2)` or `new = dict.merge(d1, d2)` are enough.

Python preferred name over symbol in general.
Symbols are readable and understandable only when it has good
math metaphor.

Sets has symbol operator because it is well known in set in math,
not because set is frequently used.

In case of dict, there is no simple metaphor in math.
It just cryptic and hard to Google.

-- 
INADA Naoki  <songofacandy at gmail.com>


More information about the Python-ideas mailing list