<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The two statements you wrote are not the same. The first statement will error out if person is None.<span> </span></span></blockquote><div>That's my bad. I was copying off of an erroneous example. Thanks for correcting me.<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The proposed None-aware operators are specifically designed to handle variables that may be None.</span><br></blockquote><div>Yes, I think the syntax that you've landed on is confusing enough that it opens the door to more errors than it closes. Just reading "<span class="gmail-pre" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12.1875px;line-height:inherit;font-family:monospace;vertical-align:baseline;white-space:nowrap;color:rgb(68,68,68);background-color:rgb(249,249,249);text-decoration-style:initial;text-decoration-color:initial">(a?.b</span><span style="color:rgb(68,68,68);font-family:monospace;font-size:12.1875px;background-color:rgb(249,249,249);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span><span class="gmail-pre" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12.1875px;line-height:inherit;font-family:monospace;vertical-align:baseline;white-space:nowrap;color:rgb(68,68,68);background-color:rgb(249,249,249);text-decoration-style:initial;text-decoration-color:initial">??</span><span style="color:rgb(68,68,68);font-family:monospace;font-size:12.1875px;background-color:rgb(249,249,249);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span><span class="gmail-pre" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:12.1875px;line-height:inherit;font-family:monospace;vertical-align:baseline;white-space:nowrap;color:rgb(68,68,68);background-color:rgb(249,249,249);text-decoration-style:initial;text-decoration-color:initial">c).d?.e" and "<span style="white-space:normal;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">await </span><span class="gmail-pre" style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;text-decoration-style:initial;text-decoration-color:initial">a?.b(c).d?[e]" </span></span></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 25, 2018 at 6:06 PM, Nicholas Chammas <span dir="ltr"><<a href="mailto:nicholas.chammas@gmail.com" target="_blank">nicholas.chammas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div dir="ltr">On Wed, Jul 25, 2018 at 6:11 PM Abe Dillon <<a href="mailto:abedillon@gmail.com" target="_blank">abedillon@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The problem here is not whether it's explicit. It's about Readability and conciseness. Using symbols in place of words almost always harms readability in favor of conciseness.<br><br>value = <a href="http://person.name" target="_blank">person.name</a> if <a href="http://person.name" target="_blank">person.name</a> else person<br><br>almost reads like english (aside from being a weird and totally uncommon use case)<br><br>value = person?.name<br><br>Is a huge step towards the concise illegible soup of symbols that Perl is famous for. It's a huge No from me.<br></div></blockquote><div><br></div></span><div>The two statements you wrote are not the same. The first statement will error out if person is None. The proposed None-aware operators are specifically designed to handle variables that may be None.</div><div><br></div><div>The first statement should instead read:</div><div><br></div><div> value = <a href="http://person.name" target="_blank">person.name</a> if person is not None else person</div><div><br></div><div>That's what `value = person?.name` means.</div><div><br></div><div>As others have pointed out, I suppose the fact that multiple people have messed up the meaning of the proposed operators is concerning. Perhaps the PEP could be improved by adding some dead simple examples of each operator and an equivalent statement that doesn't use the operator, to better illustrate their meaning. But I gather that will do little in the way of addressing some of the stronger objections raised here.</div></div></div>
</blockquote></div><br></div>