On 12/24/2009 12:11 PM, Terry Reedy wrote:
This buggy idiom survived many years of Python development, missed by
virtually everyone.
The last statement is false. The hazard of using and/or was well-known
back in '97 or so when I discovered or learned it and I believe it was
mentioned in the FAQ entry on the subject. The new alternative has the
hazard that the condition and if-branch must be written and read in a
backwards order. I consider that buggy and do not use it for that reason.
Oh really? I thought putting the conditional in the middle was
ingenious, whoever thought that must have the next Turing award!
I always feel there's something wrong with the (condition ? true :
false) or (if condition then true else false) expressions found in other
languages; and just realized it was because of their unnatural ordering.
I have to admit initially the reversed ordering do confound me, but
afterward it felt even more natural than the traditional
"conditional-first" expression.
--
http://mail.python.org/mailman/listinfo/python-list