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

Christopher Barker pythonchb at gmail.com
Sat Mar 23 12:24:04 EDT 2019


> > I think that's a good indication that there are uses for a merge
> > operator.
>
> Some, yes.  Enough for new syntax?


Let’s be clear here — this would not be new syntax — the operator (s)
already exist and are commonly used and overloaded already. This would be a
minor change to the dictionary class (and maybe the Mapping ABC), not a
change to the language.


 Are
> there existing syntax features so sparsely used?


I wonder how often + is used with lists in the stdlib...

What is the bar for
> something that adds no new function, but saves 6 chars and is easier to
> understand for at least some?


The “height of the bar” depends not just on how it would be used, but by
how disruptive it is. As this is not nearly as disruptive as, say :=, I
think the bar is pretty low.

But others seem to think it would add great confusion, which would raise
the bar a lot.

By the way, if it isn’t used much, that also means it wouldn’t be very
disruptive. :-)

I’m coming down on the side of “not worth the argument”

-CHB
-- 
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190323/40059b8e/attachment.html>


More information about the Python-ideas mailing list