[Python-ideas] PEP: Dict addition and subtraction
davidfstr at gmail.com
Tue Mar 5 00:37:54 EST 2019
I have seen a ton of discussion about what dict addition should do, but
have seen almost no mention of dict difference.
This lack of discussion interest combined with me not recalling having
needed the proposed subtraction semantics personally makes me wonder if
we should hold off on locking in subtraction semantics just yet. Perhaps
we could just scope the proposal to dictionary addition only for now?
If I *were* to define dict difference, my intuition suggests supporting
a second operand that is any iterable of keys and not just dicts.
(Augmented dict subtraction is already proposed to accept such a broader
David Foster | Seattle, WA, USA
On 3/1/19 8:26 AM, Steven D'Aprano wrote:
> Attached is a draft PEP on adding + and - operators to dict for
> This should probably go here:
> 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.
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
More information about the Python-ideas