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

Donald Stufft donald at stufft.io
Thu Mar 6 03:23:37 CET 2014


On Mar 5, 2014, at 9:15 PM, Tim Peters <tim.peters at gmail.com> wrote:

> [Donald Stufft]
>> When the documented behavior is both nonsensical and the cause of hard
>> to debug bugs that is a pretty compelling use case to me, unless you actively
>> enjoy being user hostile.
> 
> Breaking code that currently works is as hostile as hostile gets.
> Where is the evidence that no code relies on the current behavior?
> For that matter, where is the evidence that the current behavior is a
> significant cause of bugs?  I know I've used "if some_time_object:",
> but it did exactly what I expected it to do.

Forgive me if I’m wrong, but aren’t you the author of the date time module? If that’s
the case what you expect it to do isn’t particularly relevant as you’re intimately aware
of it’s implementation.

It’s hard to do any sort of search for this, however in an informal poll where I’ve shown
people this code not a single person thought it made sense, and most of them responded
with “wtf?”. 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.

-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140305/6b3e8888/attachment.sig>


More information about the Python-ideas mailing list