[Python-ideas] PEP: Dict addition and subtraction

Steven D'Aprano steve at pearwood.info
Fri Mar 15 12:44:02 EDT 2019


On Fri, Mar 15, 2019 at 12:34:45PM +0100, Antoine Pitrou wrote:
> On Thu, 7 Mar 2019 10:58:02 +1100
> Chris Angelico <rosuav at gmail.com> wrote:
> > 
> > Lots of words that basically say: Stuff wouldn't be perfectly pure.
> 
> Chris, please learn to think twice before contributing what is
> essentially a trivialization of someone else's arguments.  You're not
> doing anything useful here, and are just sounding like an asshole who
> wants to shut people up.

I don't think you are being fair here, and I'd rather avoid getting into 
unhelpful arguments about tone and whether Chris is "trivializing" (a 
perjorative term) or "simplifying" (a more neutral term) Josh's 
position. But if you feel that Chris (and I) have missed parts of Josh's 
argument, then by all means point out what we missed.

Josh, the same applies to you: I do want to give your objections a fair 
hearing in the updated PEP, so if you think I've missed something, 
please point it out.

In context, I think Chris' response was valid: he was responding to 
a post by Josh whose entire argument was that using + for dict merging 
is an abuse of the + symbol because it isn't like numeric addition.

If there is more to Josh's argument, can you point out to me what I have 
missed please? That's a genuine request, not a rhetorical question.

Here's Josh's argument:

https://mail.python.org/pipermail/python-ideas/2019-March/055733.html

and for context, here is Chris' dismissal of Josh's argument:

https://mail.python.org/pipermail/python-ideas/2019-March/055734.html

and his explanation of why he is dismissing it.

Chris is well within his right to dismiss an argument that doesn't 
impress him, which he did by summarizing it as "Stuff wouldn't be 
perfectly pure". (Pure in the sense of being like numeric addition.)

I think that's pretty much an accurate summary: Josh apparently doesn't 
like using + for anything that isn't purely like + for real numbers. He 
calls using + for concatentation a "minor abuse" of the operator and 
argues that it would be bad for dict meging to use + because merging has 
different properties to numeric addition. (He has also criticised the 
use of + for concatenation in at least one other post.)

He even gives qualified support for a dict merge operator:

    "there's nothing wrong with making dict merges easier"

but just doesn't like the choice of + as the operator.

He's entitled to his opinion, and Chris is entitled to dismiss it. 


(Aside: your email appears to have broken threading. I'm not sure 
why, your other emails seem to be threaded okay.)


-- 
Steven


More information about the Python-ideas mailing list