[Python-ideas] PEP: Dict addition and subtraction

Steven D'Aprano steve at pearwood.info
Thu Mar 21 19:55:08 EDT 2019

On Thu, Mar 21, 2019 at 03:10:48PM -0700, Brandt Bucher wrote:
> For anyone interested in "trying it out": if you're not against cloning and
> compiling CPython yourself, here is a PEP 584 C implementation I have PR'd
> against master right now. I'm keeping it in sync with the draft PEP as it
> changes, so subtraction performance is not overly optimized yet, but it
> will show you the *exact* behavior outlined in the PEP on the dict builtin
> and its subclasses. The relevant branch is called "addiction". You can
> clone it from:

That's great, thank you!

For the sake of comparisons, could you support | as an alias? That will 
allow people to get a feel for whether a+b or a|b looks nicer.

(For the record, the PEP isn't set in stone in regards to the choice of 

> https://github.com/brandtbucher/cpython.git


More information about the Python-ideas mailing list