On Sun, 22 Feb 2009 05:20:31 -0200
"Gabriel Genellina" <gagsl-...@yahoo.com.ar> wrote:
> En Sat, 21 Feb 2009 21:55:23 -0200, MRAB <goo...@mrabarnett.plus.com>  
> escribió:
> > I think it's because midnight is to the time of day what zero is to
> > integers, or an empty string is to strings, or an empty container ...
> 
> So chr(0) should be False too...

>>> chr(0)
'\x00'

That's not an empty string.  This is like...

>>> bool([0])
True

Now if Python had a char type one might expect the zero char to be
False but a collection of anything, even if the elements are False, is
not empty and hence is True.

As someone else said, there's not much point in casting time to boolean
but if you do, it is a base type, not a sequence so I wouldn't expect
to apply sequence logic to the outcome.

-- 
D'Arcy J.M. Cain <da...@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to