
Sept. 28, 2015
9:04 p.m.
On 09/28/2015 02:54 PM, Guido van Rossum wrote:
If you want to dumb down the feature so that foo?.bar.baz means just (foo?.bar).baz then it's useless and I should just reject the PEP.
I think you're right that in practice ?. and ?[ would probably be just fine, because the scope of their action is still quite limited. 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. Carl