Why is None <= 0

Ben Finney bignose+hates-spam at benfinney.id.au
Sat Apr 26 00:47:26 EDT 2008


Grant Edwards <grante at visi.com> writes:

> On 2008-04-25, D'Arcy J.M. Cain <darcy at druid.net> wrote:
> > On Fri, 25 Apr 2008 20:27:15 +0200
> > Gregor Horvath <gh at gregor-horvath.com> wrote:
> >>  >>> None <= 0
> >> True
> > Everything in Python can compare to everything else.
> 
> Not true.

Even more untrue in Python 3.0:

    Comparisons other than == and != between disparate types will
    raise an exception unless explicitly supported by the type

    <URL:http://www.python.org/dev/peps/pep-3100/#core-language>
    <URL:http://mail.python.org/pipermail/python-dev/2004-June/045111.html>

-- 
 \     "We demand rigidly defined areas of doubt and uncertainty!"  -- |
  `\     Vroomfondel, _The Hitch-Hiker's Guide To The Galaxy_, Douglas |
_o__)                                                            Adams |
Ben Finney



More information about the Python-list mailing list