[Python-ideas] Please reconsider the Boolean evaluation of midnight

Tim Peters tim.peters at gmail.com
Thu Mar 6 18:13:36 CET 2014


[Antoine Pitrou <solipsis at pitrou.net>]
> ...
> It is not a coincidence, IMO, that the three persons arguing that the
> current behaviour is reasonable are implementors of datetime modules: you,
> Tim and Alexander. All other people find the behaviour baffling.

The behavior of "aware" time objects is indeed bizarre, but then aware
time objects are bizarre beasts from the start (a time zone attached
to a mere time-of-day, divorced from date info, doesn't make any real
sense to me).

The reasons I already explained (possible extensions to naive time's
repertoire, in the areas of type conversions and arithmetic) account
for why bool(time()) returns False.  _As things turned out_ no such
extensions were made, so we're left with a foundation sticking out of
the ground with nothing built on top of it.

Yawn ;-)


More information about the Python-ideas mailing list