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

Ryan Hiebert ryan at ryanhiebert.com
Wed Mar 5 16:20:57 CET 2014


On Wed, Mar 5, 2014 at 9:01 AM, Paul Moore <p.f.moore at gmail.com> wrote:

> On 5 March 2014 13:53, Shai Berger <shai at platonix.com> wrote:
>
> We don't. Can we agree that it's not a bug and abandon this fruitless
> discussion.


Please don't abandon this discussion. The behavior we're discussing is
clearly illogical and useless.

If we simply removed the __nonzero__ behavior, and it did what user-created
types do, then it would perform as I would expect it to.

Consider also that this time has no special significance, unlike the
special cases of 0, (), {}, etc. This is true also for any arbitrarily
zeroed unit, such as temperature (C or F), and including datetime, date,
and time. Even zero in those cases (however that is defined) is simply an
arbitrary point, and not the same as a nonzero value.

This is completely illogical behavior, and, IMO, is a bug.

Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140305/bb7db7b8/attachment.html>


More information about the Python-ideas mailing list