<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 29, 2017 at 3:12 PM Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">29.11.17 15:01, Stephan Houben пише:<br>
> What about a more general:<br>
><br>
> A if <binary_relation> B else C<br>
><br>
> which would allow<br>
><br>
> A if is not None else C<br>
><br>
> but also e.g.<br>
><br>
> A if >= 1 else 0<br>
<br>
This look the most "natural" to me. I.e. the least "unnatural". If we<br>
even will introduce a new special syntax I will prefer this syntax.<br>
<br>
The only disadvantage is that this will prevent introducing "angular<br>
parenthesis" in future: A if <X, Y, Z> == B else C.<br>
<br></blockquote><div><br></div><div>Also, how do you treat more complex conditions? do you prohibit them?</div><div><br></div><div>    A if >= 0 and < 2 else 0</div><div>    B if >= 0 or < -1 else -1</div><div>    C if and B else A   # i.e. C if C and B else E</div><div>    D if -y else E  # is this an unary minus or a binary operation?</div><div><br></div><div>If any of these is allowed, it might confuse people.</div><div>It also break the ability to extract subexpression to variables.</div><div><br></div><div>(I kinda like this idea, but it doesn't look like a small, simple change to the language, whereas ?? does).</div><div><br></div><div>Elazar</div><div><br></div></div></div>