<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 21, 2015 at 4:47 PM, Random832 <span dir="ltr"><<a href="mailto:random832@fastmail.com" target="_blank">random832@fastmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Sep 21, 2015, at 17:48, Guido van Rossum wrote:<br>
> This is important when x is a more complex expression that is either<br>
> expensive or has a side-effect. E.g. d.get(key)?.upper() would currently<br>
> have to be spelled as (some variant of) "None if d.get(key) is None else<br>
> d.get(key).upper()" and the ?? operator doesn't really help for the<br>
> repetition -- it would still be "d.get(key) ?? d.get(key).upper()".<br>
<br>
</span>?? is meant to use the right if the left *is* null, as I understand it.<br>
So this isn't a problem it solves at all.<br></blockquote></div><br></div><div class="gmail_extra">Sorry, my bad. Indeed, x ?? y tries to fix the issue that "x or y" uses y if x is falsey. Still this seems a lesser problem to me than the problem solved by x?.a and x?[y]. Most of the time in my code it is actually fine to use the default if the LHS is an empty string.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>