[Python-3000] None in Comparisons

Victor Stinner victor.stinner at haypocalc.com
Tue Nov 11 15:38:43 CET 2008


Le Tuesday 11 November 2008 15:21:03 M.-A. Lemburg, vous avez écrit :
> Because None is already special, has had this feature for a very
> long time (...)

Yeah, Python3 breaks compatibility by removing old dummy behaviour like 
comparaison between bytes and characters, or between an integer an None ;-)

I like the new behaviour, it helps to detect bugs earlier ! I hope that 
the -bb option will be enabled by default in Python 2.7 :-)

You can use an explicit comparaison to None as workaround for your problem:
   (x is None) or (x < y)

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/


More information about the Python-3000 mailing list