[Python-ideas] Null coalescing operator

Guido van Rossum guido at python.org
Tue Nov 1 10:46:30 EDT 2016


I personally find the ?keyword pattern has less appeal than ?, ?? or ?. .

On Tue, Nov 1, 2016 at 4:02 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> On 1 November 2016 at 20:28, Paul Moore <p.f.moore at gmail.com> wrote:
> > On 1 November 2016 at 10:11, Nick Coghlan <ncoghlan at gmail.com> wrote:
> >>
> >> I do think it would be worth covering the symbol+keyword option
> >> discussed in PEP 531 (i.e. "?else" instead of "??", but keeping "?.",
> >> and "?[")
> >
> > FWIW, I'm not keen on it.
> >
> > As a technical question, would it be treated in the syntax as a
> > keyword, which happened to be made up of a punctuation character
> > followed by letters, or as a ? symbol followed by a keyword?
>
> Combined keyword, rather than two distinct tokens.
>
> If you don't do that, you end up creating ambiguities for other
> possible uses of "?" (like the "." and "?[]" suggestions)
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161101/c141988f/attachment-0001.html>


More information about the Python-ideas mailing list