2009/2/22 Mark Dickinson <dicki...@gmail.com>:
> On Feb 21, 10:44 pm, Ethan Furman <et...@stoneleaf.us> wrote:
>
>> --> midnight = datetime.time(0,0,0)
>> --> bool(midnight)
>> False
>
> I'd call this a bug.

No more so than zero being false. Zero exists too (check my bank
balance). Once you've accepted non-Boolean types having Boolean
values, the logic of what value they have is always going to be a bit
hairy. If you're unsure of the logic, just test against a value or a
range. After all, what value do you *expect* a time of day to have
when interpreted as a Boolean? If you don't have an expectation, why
are you interpreting it as a Boolean?


-- 
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to