[Python-Dev] Boolean transition
Christian Tismer
tismer@tismer.com
Tue, 12 Mar 2002 01:14:56 +0100
Christian Tismer wrote:
> Tim Peters wrote:
>
>>>> days_in_year = 365 + is_leap(year)
>>>>
>>
>> [Greg Ewing]
>>
>>> This is bug-prone, because it relies on is_leap always
>>> returning a "normalised" boolean value.
>>
> ...
>
>
>>> ...
>>> and similarly
>>>
>>> days_in_year = 365 + 1 if is_leap(year) else 0
>>>
>>> (Yes, I know that one's already been rejected. I can't stop
>>> liking it, though...)
>>>
>>
>> Heh. I immediately read that as
>>
>> days_in_year = (365 + 1) if is_leap(year) else 0
>>
>> I'm old enough to wish reality played along <wink>.
>
>
>
> If I would calculate my age using the above formula, it would
> be about 34. A fountain of youth!
Oh, sorry, I was even worse! My age would be 11 :-))
--
Christian Tismer :^) <mailto:tismer@tismer.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Kaunstr. 26 : *Starship* http://starship.python.net/
14163 Berlin : PGP key -> http://wwwkeys.pgp.net/
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
where do you want to jump today? http://www.stackless.com/