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

Chris Angelico rosuav at gmail.com
Thu Mar 6 15:04:01 CET 2014


On Thu, Mar 6, 2014 at 10:40 PM, Rob Cliffe <rob.cliffe at btinternet.com> wrote:
> 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?

If the first one is marked deprecated, then I'd just ignore that one.
The only (minor) downside is remembering which one's the deprecated
one, so I avoid wasting time going to its docs and then going to the
other. Compare:

http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Sql/postgres.html
http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Sql/pgsql.html

In new code, which of those would you use? Is it sufficiently clear? I
think it is.

With Python's time types, though, there may be links with datetime.
Which type does datetime.time() return? Will there be two parallel
methods to resolve that? It's slightly more complicated. Still, it's
not a killer. I've worked with far messier APIs - look at PHP and
MySQL and the "real" functions. Which ones do you need _real_ in and
which not?

ChrisA


More information about the Python-ideas mailing list