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

Stephen J. Turnbull stephen at xemacs.org
Fri Mar 7 04:58:45 CET 2014


Greg Ewing writes:
 > Barry Warsaw wrote:
 > > On Mar 06, 2014, at 11:56 AM, Rob Cliffe wrote:
 > > 
 > >>Instances of existing code that would be broken by the change: 0
 > > 
 > > You can't know this because you can't audit all the Python code
 > > in the world.
 > 
 > I think he means instances that have been pointed out
 > so far in this discussion.

Well, either way it's a pretty careless claim.

Alexander and Tim both have stated that they have used "if time:" to
test for a zero time (per the documentation) in actual applications.
I gather from the fact that Tim is "-0" on the change that his code
was never widely distributed, but I don't know about Alexander's.
Probably not, as he didn't post a URL, either.  AFAIK the code doesn't
have to be distributed for gratuitous code breakage to be considered a
Very Bad Thing, though.

One of Alexander's use cases (changing date in a simulation at
midnight using naive times) is particularly salient here.  Unlike any
of the other cases described so far by either side, it's clear that
his simulation would be completely broken by the proposed incompatible
change in behavior, as the date would never change.  (Granted, it's
not clear to me whether he actually implemented this in production,
but I also can't say from what I've read that he didn't.)



More information about the Python-ideas mailing list