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

Shai Berger shai at platonix.com
Wed Mar 5 16:15:29 CET 2014


On Wednesday 05 March 2014 16:34:16 Skip Montanaro wrote:
> 
> Let's change the problem slightly. Instead of time objects, let's
> consider the domain of possible values to be integers. Clearly, None
> is not a member of that set. You could thus use it as a sentinel. So,
> tell me, OP. Would this usage be correct?
> 
>     if event.some_id:
>         # stuff
> 
> I would argue, "no." I would not argue that 0 should not compare as
> False, however.

What Yann said. Also, when opening this thread, I argued that 0 is special, 
but midnight is not -- which you completely ignore.

Thanks,
	Shai.


More information about the Python-ideas mailing list