
Sept. 29, 2015
5:35 p.m.
On Sep 28, 2015, at 03:04 PM, Carl Meyer wrote:
But even if they are rejected, I think a simple `??` or `or?` (or however it's spelled) operator to reduce the repetition of "x if x is not None else y" is worth consideration on its own merits. This operator is entirely unambiguous, and I think would be useful and frequently used, whether or not ?. and ?[ are added along with it.
But why is it an improvement? The ternary operator is entirely obvious and readable, and at least in my experience, is rare enough that the repetition doesn't hurt my fingers that much. It seems like such a radical, ugly new syntax unjustified by the frequency of use and readability improvement. Cheers, -Barry