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

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Sep 30 02:24:50 CEST 2015

On Tue, Sep 29, 2015 at 7:57 PM, Andrew Barnert via Python-ideas <
python-ideas at python.org> wrote:

> If this is going to be a keyword rather than a symbol, it really has to
> read like English, or at least like abbreviated English,

I am -1 on this whole idea, but the keyword that comes to mind is "def":

x def []

may be read as x DEFaulting to [].

If this was a Python 4 idea, I would suggest repurposing the rarely used
xor operator: ^ and make x ^ y return the non-None of x and y or None if
both are None.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150929/c1c5a8e2/attachment.html>

More information about the Python-ideas mailing list