On 8/17/2016 2:43 PM, Marko Rauhamaa wrote:
Terry Reedy <tjre...@udel.edu>:
On 8/17/2016 2:39 AM, Steven D'Aprano wrote:
"If I finish work on on time, go to the movies, otherwise just go home."
is also real English syntax, and to me, more graceful. It is certainly
more neutral among the alternatives. The inverted version implies a
clear preference for the first alternative.
It would be an interesting exercise to see which order for ternary
expressions is more common in some large corpus of English text.
Python's ternary expression has a distinct Perl flavor to it.
One of the ironies (or puzzles) of Guido's choice is that he once
condemned Perl's 'value if cond' as wretched. I never got an answer as
to whether he changed his mind on that or if adding 'else otherval' made
it unwretched. Whatever the case, it does not matter to me now. I once
'boycotted' the ternary but now use it where I think it better than the
alternative.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list