<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 28, 2015 at 10:38 AM, Carl Meyer <span dir="ltr"><<a href="mailto:carl@oddbird.net" target="_blank">carl@oddbird.net</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 09/28/2015 11:29 AM, Guido van Rossum wrote:<br>
> On Mon, Sep 28, 2015 at 9:02 AM, Jeff Hardy <<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>>> wrote:<br>
><br>
>     -1 on the propagating member-access or index operators<br>
><br>
><br>
> Can someone explain with examples what this refers to?<br>
<br>
</span>"Member-access or index operators" refers to the proposed ?. or ?[<br>
operators.<br></blockquote><div><br></div><div>Got that. :-)<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
"Propagating" refers to the proposed behavior where use of ?. or ?[<br>
"propagates" through the following chain of operations. For example:<br>
<br>
    x = foo?.bar.spam.eggs<br>
<br>
Where both `.spam` and `.eggs` would behave like `?.spam` and `?.eggs`<br>
(propagating None rather than raising AttributeError), simply because a<br>
`.?` had occurred earlier in the chain. So the above behaves differently<br>
from:<br>
<br>
    temp = foo?.bar<br>
    x = temp.spam.eggs<br>
<br>
Which raises questions about whether the propagation escapes<br>
parentheses, too:<br>
<br>
    x = (foo?.bar).spam.eggs<span class="HOEnZb"></span><br></blockquote></div><br></div><div class="gmail_extra">Oh, I see. That's evil.<br><br></div><div class="gmail_extra">The correct behavior here is that "foo?.bar.spam.eggs" should mean the same as<br><br></div><div class="gmail_extra">    (None if foo is None else foo.bar.spam.eggs)<br><br></div><div class="gmail_extra">(Stop until you understand that is *not* the same as either of the alternatives you describe.)<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I can see the confusion that led to the idea of "propagation" -- it probably comes from an attempt to define "foo?.bar" without reference to the context (in this case the relevant context is that it's followed by ".spam.eggs").<br><br></div><div class="gmail_extra">It should not escape parentheses.<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>