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

Tim Peters tim.peters at gmail.com
Thu Mar 6 03:33:53 CET 2014


> Forgive me if I'm wrong, but aren't you the author of the date time module?

Yes.

> If that's the case what you expect it to do isn't particularly relevant as you're
> intimately aware of it's implementation.

Drat!  Checkmated again!  I get tired of putting smileys after everything ;-)

> It's hard to do any sort of search for this, however in an informal poll where I've shown
> people this code

Precisely which code did you show them?  What were the backgrounds of
these people?  Etc etc etc.

> not a single person thought it made sense, and most of them responded
> with "wtf?"

Which, via amazing coincidence or foresight, is exactly what I bet you
were expecting ;-)


>. I've also seen first hand through Django (which is why the person who started
> this thread) get caught by this bug and have to spend hours trying to figure out why it's
> behaving that way.

Too sketchy to say much about.  If this is a variation of testing "if
object:" as a shorthand for testing "if object is None:", little
sympathy from me.

In any case, this took more of my time so far than any possible
outcome would be worth to me, so I'll just close with -0 on changing
it (would rather not bother, but won't complain if it is changed).


More information about the Python-ideas mailing list