[Python-ideas] Null coalescing operator
Steven D'Aprano
steve at pearwood.info
Fri Sep 9 20:27:19 EDT 2016
On Fri, Sep 09, 2016 at 10:01:44PM +0200, Arek Bulski wrote:
> Sometimes I find myself in need of this nice operator that I used back in
> the days when I was programming in .NET, essentially an expression
>
> >>> expr ?? instead
>
> should return expr when it `is not None` and `instead` otherwise.
As Zach and MRAB mention, this was discussed last year. If I recall
correctly, the discussion fizzled out without a solid conclusion. I
think there's a PEP -- if not, there should be.
I would be interested in revisiting this idea, but 3.6 feature freeze is
only a day or two away and I won't have time to discuss this before
then. So let's please drop this discussion until the 3.6 beta is
released.
--
Steve
More information about the Python-ideas
mailing list