<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">Op 29 nov. 2017 22:35 schreef "Greg Ewing" <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br></div>
It would read better with some kind of pronoun in there:<br>
<br>
A if it is not None else C<br>
<br>
Hypercard's Hypertalk had a special variable "it" that<br>
worked sort of like that.</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I considered that, but there are two issues.</div><div dir="auto"><br></div><div dir="auto">1. Backward-incompatible change</div><div dir="auto"><br></div><div dir="auto">2. The semantics of</div><div dir="auto">A if B else C</div><div dir="auto">now depends on if B contains 'it', </div><div dir="auto">in which case A gets evaluated unconditionally and prior to B.</div><div dir="auto">What if evaluation of 'it' is itself conditional, e.g.</div><div dir="auto"><br></div><div dir="auto">print("hello") if a or it else print("goodbye")</div><div dir="auto"><br></div><div dir="auto">Note that in the </div><div dir="auto"><br></div><div dir="auto">A if <binary_relation> B else C</div><div dir="auto"><br></div><div dir="auto">proposal the evaluation of the implicit 'it' is never conditional in that way.</div><div dir="auto"><br></div><div dir="auto">Stephan</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font color="#888888"><br>
<br>
-- <br>
Greg</font><div class="elided-text"><br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</div></blockquote></div><br></div></div></div>