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

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 6 00:23:28 CET 2014


Paul Moore wrote:
> Agreed that the odd behaviour of time in a
> boolean context is why this whole class of bugs exists, but it's only
> a subclass if the wider problem that people shouldn't truth-test
> values without thinking

But this bites you even if you *do* think, because there
is no reason to suspect that any time value should be
regarded as false, especially since the docs make no
mention of this.

Note that "fix the docs" is *not* the right response to
this, IMO -- that would just be enshrining a bad design
decision. Better to fix the design while we have the
chance.

-- 
Greg


More information about the Python-ideas mailing list