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

Rob Cliffe rob.cliffe at btinternet.com
Thu Mar 6 12:40:21 CET 2014


On 06/03/2014 10:52, Steven D'Aprano wrote:
>
> True, as I mentioned in another post.
>
> Nevertheless, we have many arbitrary conventions enshrined in Python.
> Using base 10 for the representation of numbers, instead of, say,
> balanced ternary notation, is an arbitrary convention. Numbering
> sequences from 0 is another.
>
> If you would prefer another convention for the zero point of the day
> (say, midday, dusk, dawn, or 2:15pm) then feel free to subclass
> datetime.time :-)
>
> Or even no zero point at all. Tossing out a wild idea, why not leave
> datetime.time alone and add a new class which is exactly the same but is
> always truthy? That doesn't break backward compatibility, and so it
> could happen immediately (too late for 3.4, but certainly for 3.5).
>
> All we need is an appropriate name, and a decision as to which ought to
> inherit from which. The bike-shedding should be over by 3.5 alpha 1
> *wink*
>
> Despite my quip about the bike-shedding, I am actually serious.
You're joking, right?
Suppose you were considering taking up a new language and you found 
something in the docs which said:
"Here's a class that does so-and-so.  And here's another slightly 
different one that you can use instead, because we didn't get the first 
one quite right."
Would that be a turn-on?
Rob Cliffe
>   
>



More information about the Python-ideas mailing list