datetime.time and midnight

Joshua Judson Rosen rozzin at geekspace.com
Sun Feb 22 22:06:35 CET 2009


"D'Arcy J.M. Cain" <darcy at druid.net> writes:
>
> On Sun, 22 Feb 2009 05:20:31 -0200
> "Gabriel Genellina" <gagsl-py2 at yahoo.com.ar> wrote:
> > En Sat, 21 Feb 2009 21:55:23 -0200, MRAB <google at 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.

And, as Halmos said:

   A box that contains a hat and nothing else is not the same thing as
   a hat....

:)

-- 
Don't be afraid to ask (Lf.((Lx.xx) (Lr.f(rr)))).



More information about the Python-list mailing list