On Wed, Mar 5, 2014 at 11:24 AM, Steven D'Aprano <steve@pearwood.info> wrote:
There's also the argument from consistency: midnight is the zero point
of the day, and zero is falsey. It would be surprising if something
which is essentially zero became truthy.

I don't think it's consistent now.

In Boolean contexts ...

  • timedelta object is considered to be true if and only if it isn’t equal to timedelta(0).
  • all date objects are considered to be true.
  • all datetime objects are considered to be true.
  • time object is considered to be true if and only if, after converting it to minutes and subtracting utcoffset() (or 0 if that’s None), the result is non-zero.

And the documentation is not exactly clear for understanding when a time object is falsey. In particular, the "converting it to minutes" part seems irrelevant as a time of 1 microsecond from midnight is truthy and timedeltas are not numbers and are not in minutes. Perhaps a reasonable improvement would be to change this to:

--- Bruce
Learn how hackers think: http://j.mp/gruyere-security