<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 19, 2018, 08:47 Rhodri James <<a href="mailto:rhodri@kynesim.co.uk">rhodri@kynesim.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 19/07/18 09:33, Antoine Pitrou wrote:<br>
> There is a use case I sympathize with: the argument-is-None case.  For<br>
> that I would suggest a simpler form:  "A else B" which would evaluate<br>
> to A if A is not None, otherwise to B (parentheses may be mandatory).<br>
> <br>
> So e.g. one of the examples would read:<br>
> <br>
>       def insort_right(a, x, lo=0, hi=None):<br>
>           # ...<br>
>           hi = hi else len(a)<br>
>           # ...<br>
<br>
Much as I would like a keyword, "else" is the wrong one.  It implies we <br>
are dealing with truthiness, which we aren't, and lays a subtle semantic <br>
trap as a consequence.<br>
<br>
If anyone can think of a good word for "if it isn't None, otherwise", <br>
I'd be all for it :-)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">What about "nelse"?</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>