[Python-ideas] PEP: Dict addition and subtraction

INADA Naoki songofacandy at gmail.com
Sun Mar 3 21:53:27 EST 2019


I think "Current Alternatives" section must refer to long existing idiom,
in addition to {**d1, **d2}:

    d3 = d1.copy()
    d3.update(d2)

It is obvious nor easily discoverable, while it takes two lines.
"There are no obvious way" and "there is at least one obvious way" is
very different.

On Sat, Mar 2, 2019 at 1:27 AM Steven D'Aprano <steve at pearwood.info> wrote:
>
> Attached is a draft PEP on adding + and - operators to dict for
> discussion.
>
> This should probably go here:
>
> https://github.com/python/peps
>
> but due to technical difficulties at my end, I'm very limited in what I
> can do on Github (at least for now). If there's anyone who would like to
> co-author and/or help with the process, that will be appreciated.
>
>
> --
> Steven
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
INADA Naoki  <songofacandy at gmail.com>


More information about the Python-ideas mailing list