Greetings, List!
I was curious if anyone knew the rationale behind making midnight False?
--> import datetime
--> midnight = datetime.time(0,0,0)
--> bool(midnight)
False
To my way of thinking, midnight does actually exist so it should be
true. If datetime.time was measuring an *amount* of ti
Ethan Furman wrote:
Greetings, List!
I was curious if anyone knew the rationale behind making midnight False?
--> import datetime
--> midnight = datetime.time(0,0,0)
--> bool(midnight)
False
To my way of thinking, midnight does actually exist so it should be
true. If datetime.time was measur
On Feb 21, 10:44 pm, Ethan Furman wrote:
> Greetings, List!
>
> I was curious if anyone knew the rationale behind making midnight False?
>
> --> import datetime
> --> midnight = datetime.time(0,0,0)
> --> bool(midnight)
> False
>
> To my way of thinking, midnight does actually exist so it should b
Paddy3118 wrote:
> Ethan,
> Knights are true and seek the light. Evil trolls seek the night and so
> their hour is false.
>
> ;-)
That's speciest *and* lightist. There's nothing wrong with avoiding the evil
burning day star, that's practically de rigour for programmers.
*wink*
--
Steven
En Sat, 21 Feb 2009 21:55:23 -0200, MRAB
escribió:
Ethan Furman wrote:
Greetings, List!
I was curious if anyone knew the rationale behind making midnight
False?
--> import datetime
--> midnight = datetime.time(0,0,0)
--> bool(midnight)
False
To my way of thinking, midnight does actuall
On Feb 21, 10:44 pm, Ethan Furman wrote:
> --> midnight = datetime.time(0,0,0)
> --> bool(midnight)
> False
I'd call this a bug.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 22, 9:18 am, Mark Dickinson wrote:
> On Feb 21, 10:44 pm, Ethan Furman wrote:
>
> > --> midnight = datetime.time(0,0,0)
> > --> bool(midnight)
> > False
>
> I'd call this a bug.
...although looking at the source (see the function
time_nonzero in Modules/datetimemodule.c), this
behaviour i
Ethan Furman wrote:
> Greetings, List!
>
> I was curious if anyone knew the rationale behind making midnight False?
>
> --> import datetime
> --> midnight = datetime.time(0,0,0)
> --> bool(midnight)
> False
>
> To my way of thinking, midnight does actually exist so it should be
> true. If datet
On Sun, 22 Feb 2009 05:20:31 -0200
"Gabriel Genellina" wrote:
> En Sat, 21 Feb 2009 21:55:23 -0200, MRAB
> 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 t
Gabriel Genellina wrote:
En Sat, 21 Feb 2009 21:55:23 -0200, MRAB
escribió:
Ethan Furman wrote:
Greetings, List!
I was curious if anyone knew the rationale behind making midnight
False?
--> import datetime
--> midnight = datetime.time(0,0,0)
--> bool(midnight)
False
To my way of thinkin
2009/2/22 Mark Dickinson :
> On Feb 21, 10:44 pm, Ethan Furman 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
v
"D'Arcy J.M. Cain" writes:
>
> On Sun, 22 Feb 2009 05:20:31 -0200
> "Gabriel Genellina" wrote:
> > En Sat, 21 Feb 2009 21:55:23 -0200, MRAB
> > 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 cont
Tim Rowe wrote:
2009/2/22 Mark Dickinson :
On Feb 21, 10:44 pm, Ethan Furman 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-Bool
Ethan Furman writes:
>
> [...]partly because midnight is in fact a time of day, and not a lack of
> a time of day, I do indeed expect it to be True.
While it's not a lack of `time of day', it /is/ a lack of /elapsed/
time in the day ;)
Just as if you were using a plain integer or float to count
14 matches
Mail list logo