[Python-ideas] Null coalescing operator

Chris Barker chris.barker at noaa.gov
Thu Nov 3 14:36:55 EDT 2016


Thanks Steven, this is great!

so -- when all this started, I think one of the use cases was to clean up
this really common idiom:

self.an_arg = the_default if an_arg is None else an_arg

so would that be:

self.an_arg = the_default ?? an_arg

That would be nice.

Though the fact that I'm still not sure if that's correct makes me think
this is not so intuitive!

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161103/d4bad779/attachment.html>


More information about the Python-ideas mailing list