(test) ? a:b

MRAB python at mrabarnett.plus.com
Thu Oct 23 12:12:57 CEST 2014


On 2014-10-23 04:46, Gregory Ewing wrote:
> 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...
>
48K? Luxury!



More information about the Python-list mailing list