On Thu, 19 Jul 2018 at 14:29 Steve Dower <steve.do...@python.org> wrote:

> [SNIP]
>
> * "We could have 'else', we don't need '??'"
>
> This is the "a else 'default'" rather than "a ?? 'default'" proposal,
> which I do like the look of, but I think it will simultaneously mess
> with operator precedence and also force me to search for the 'if' that
> we actually need to be comparing "(a else 'default')" vs. "a ??
> 'default'"::
>
>      x = a if b else c else d
>      x = a if (b else c) else d
>      x = a if b else (c else d)
>

The searching for the 'if' also throws me with this proposal. I think
someone else proposed `A unless B` but I always prefer knowing upfront what
I'm working with, not later by having to read farther along.

Personally, if the `A?? B` is the part people like but hate the syntax then
my vote would go to `A otherwise B` since it's unambiguous, the case you
care about the state  of comes first, and it doesn't trip your brain up
looking for 'if'. :)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to