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

Tim Peters tim.peters at gmail.com
Thu Mar 6 17:50:53 CET 2014


[Bruce Leban <bruce at leapyear.org>]
>>> ...
>>> Just because you wrote the docs doesn't mean you know what they mean to
>>> other readers. The point of documentation is to explain it to someone
>>> who doesn't know what it does after all.

[Tim]
>> Of course.  What's your point here?

[Alexander Belopolsky <alexander.belopolsky at gmail.com>]
> I am with Bruce here.  I tried to digest your notes on timezone algebra [1]
> for years and I still don't understand it.
>
> [1] http://hg.python.org/cpython/file/b07400659dba/Lib/datetime.py#l1922

But those aren't user docs - they're notes for developers who are
deeply steeped in internal details.  And they're hard!  Mucking with
"all possible" time zones raises mountains of excruciatingly subtle
details and corner cases.  The masses of tedious "algebra" were needed
to justify how the internals get away with doing "so little" - and to
explain why the code still wouldn't work right in all cases if the
"standard offset" of a single time zone changed (or changes) over
time.

Do you claim you still don't understand when bool(time) returns True
and False?  Those are user docs.  I don't claim that reading them will
make anyone feel good ;-), but I do believe the computation is
described clearly enough to enable a reasonable user to predict the
result in all cases.


More information about the Python-ideas mailing list