[Python-ideas] [Python-Dev] What's the status of PEP 505: None-aware operators?

Elazar elazarg at gmail.com
Wed Nov 29 04:54:46 EST 2017


בתאריך יום ד׳, 29 בנוב׳ 2017, 11:46, מאת Steven D'Aprano ‏<
steve at pearwood.info>:

> On Wed, Nov 29, 2017 at 09:14:12AM +0200, Serhiy Storchaka wrote:
> > 29.11.17 08:08, Steven D'Aprano пише:
> > >Perl is hardly the only language with null-coalescing operators -- we
> > >might better describe ?? as being familiar to C#, PHP, Swift and Dart.
> > >That's two mature, well-known languages and two up-and-coming languages.
> >
> > What is the syntax of the ternary operator in these languages?
>
> All four use:
>
>     condition ? first : second
>
> for the ternary if operator.
>

This suggests something like "ifNone" keyword :

    x = a ifNone b ifNone c

Elazar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171129/3663c73c/attachment.html>


More information about the Python-ideas mailing list