[Python-3000] None in Comparisons: None vs. float("inf")

Tim Peters tim.peters at gmail.com
Thu Nov 13 19:55:52 CET 2008


[M.-A. Lemburg]
> ...
> So far, I haven't heard a single argument for why not having None
> participate in an ordering scheme is a good strategy to use, except
> that it's pure.

I've tracked down plenty of program logic errors that would have been
discovered more easily if comparing None to (mostly, but among others)
integers and strings had raised an exception instead of returning a
meaningless true/false result.  Perhaps you haven't.  For those who
have, the attraction to making comparisons with None refuse to return
nonsense silently is both obvious and visceral.


> IMHO, practicality beats purity in this special case.

If hiding program logic errors is practical, sure ;-)

there-is-no-behavior-no-matter-how-bizarre-someone-won't
come-to-rely-on-ly y'rs  - tim


More information about the Python-3000 mailing list