(test) ? a:b

Gregory Ewing greg.ewing at canterbury.ac.nz
Wed Oct 22 23:46:06 EDT 2014


Chris Angelico wrote:
> I've seen much MUCH worse... where multiple conditional
> expressions get combined arithmetically, and then the result used
> somewhere...

In the days of old-school BASIC it was common to
exploit the fact that boolean expressions evaluated
to 0 or 1 (or -1, depending on your dialect :) to
achieve conditional expressions or other tricks.

Probably forgiveable, given that there were no real
conditional expressions, and every byte of your 48K
or less of RAM was precious...

-- 
Greg



More information about the Python-list mailing list