
Sept. 30, 2015
12:46 a.m.
On Wed, Sep 30, 2015 at 1:24 AM, Alexander Belopolsky < alexander.belopolsky@gmail.com> wrote:
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.
I find ^ quite useful for sets, and would rather not see it repurposed in this way. Another possibility: There could be a binary version of the tilde operator, which is currently only unary: x ~ y to mean "x if x is not None else y". But I am also -1 on the whole idea, as I rarely encounter situations that would benefit from this construct. Nathan