[Python-ideas] Null coalescing operator

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 2 17:57:57 EDT 2016


MRAB wrote:
>     target = expr1 || expr2 || expr3
>     target = expr1 && expr2 && expr3
> 
> except that only None would be considered falsey?
> 
> Or would that be confusing?

Yes, I think that borrowing an operator from C but giving
it subtly different semantics would be *very* confusing,
especially to people more familiar with C than Python.
They're going to look at it and *think* they know what it
means, except they don't.

-- 
Greg


More information about the Python-ideas mailing list