[Python-ideas] PEP 505 (None coalescing operators) thoughts

Ben Finney ben+python at benfinney.id.au
Mon Sep 28 22:27:04 CEST 2015

Carl Meyer <carl at oddbird.net> writes:

> On 09/28/2015 01:53 PM, Guido van Rossum wrote:
> > On Mon, Sep 28, 2015 at 12:43 PM, Carl Meyer:
> > > I'm having trouble coming up with a parallel example where the
> > > existing short-circuit operators break "extractibility" of a
> > > sub-expression like that.
> > 
> > Why is that an interesting property?
> Because breaking up an overly-complex expression into smaller
> expressions by means of extracting sub-expressions into temporary
> variables is a common programming task

+1, this is a hugely important tool in the mental toolkit. Making that
more difficult is a high cost, thank you for expressing it so explicitly.

> it's usually one that can be handled pretty mechanically according to
> precedence rules, without having to consider that some operators might
> have action-at-a-distance beyond their precedence.
> > I don't know, but I think you shouldn't worry about this.
> I think it's kind of odd, but if nobody else is worried about it, I
> won't worry about it either :-)

I share the concerns Carl is expressing; action-at-a-distance is
something I'm glad Python doesn't have much of, and I would be loath to
see that increase.

 \      “A lie can be told in a few words. Debunking that lie can take |
  `\   pages. That is why my book… is five hundred pages long.” —Chris |
_o__)                                                Rodda, 2011-05-05 |
Ben Finney

More information about the Python-ideas mailing list