Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-02 Thread Brandt Bucher
Hi Steven. Thanks for the clarifications. I've pushed a complete working patch (with tests) to GitHub. It's linked to the bpo issue. Branch: https://github.com/brandtbucher/cpython/tree/addiction PR: https://github.com/python/cpython/pull/12088 Right now, it's pretty much a straight

Re: [Python-ideas] Dict joining using + and +=

2019-03-02 Thread MRAB
On 2019-03-02 22:02, francismb wrote: On 2/27/19 7:14 PM, MRAB wrote: Are there any advantages of using '+' over '|'? or for e.g. '<=' (d1 <= d2) over '+' (d1 + d2) '<=' is for comparison, less-than-or-equal (in the case of sets, subset, which is sort of the same kind of thing). Using it

Re: [Python-ideas] Dict joining using + and +=

2019-03-02 Thread francismb
On 2/27/19 7:14 PM, MRAB wrote: > Are there any advantages of using '+' over '|'? or for e.g. '<=' (d1 <= d2) over '+' (d1 + d2) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of

Re: [Python-ideas] Dict joining using + and +=

2019-03-02 Thread francismb
On 3/2/19 8:14 PM, Raymond Hettinger wrote: > Lastly, I'm still bugged by use of the + operator for replace-logic instead > of additive-logic. With numbers and lists and Counters, the plus operator > creates a new object where all the contents of each operand contribute to the > result.

Re: [Python-ideas] Dict joining using + and +=

2019-03-02 Thread Raymond Hettinger
> On Mar 1, 2019, at 11:31 AM, Guido van Rossum wrote: > > There's a compromise solution for this possible. We already do this for > Sequence and MutableSequence: Sequence does *not* define __add__, but > MutableSequence *does* define __iadd__, and the default implementation just > calls