[Python-ideas] Please reconsider the Boolean evaluation of midnight
Alexander Belopolsky
alexander.belopolsky at gmail.com
Wed Mar 5 22:36:14 CET 2014
On Wed, Mar 5, 2014 at 4:10 PM, Alex Gaynor <alex.gaynor at gmail.com> wrote:
> I strongly support fixing this issue. This behavior is so fundamentally
> nonsensical that resolving it is worth the potential compatibility issues.
>
Does anyone know a language that (a) has a time-of-day class in stdlib; (b)
allows
instances of that class to be used in boolean context, and (c) has a
midnight
represented by an instance that is truthy?
Here is my example of an entirely independent of Python language [1] that
nevertheless
has the same behavior for time-of-day objects:
q)`boolean$00:00:00.000
0b
q)`boolean$00:00:00.001
1b
[1] http://code.kx.com/wiki/Reference/Datatypes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140305/bdea6e6b/attachment.html>
More information about the Python-ideas
mailing list