Why is None <= 0
Grant Edwards
grante at visi.com
Fri Apr 25 20:38:56 EDT 2008
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
>>
>> Why?
>
> Why not?
>
>> Is there a logical reason?
>
> Everything in Python can compare to everything else.
Not true.
Python 2.4.4 (#1, Mar 20 2008, 09:20:52) [GCC 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.10)] on linux2
>>> 3j < 7
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: no ordering relation is defined for complex numbers
> It is up to the programmer to make sure that they are
> comparing reasonable things.
True.
--
Grant Edwards grante Yow! BEEP-BEEP!! I'm a
at '49 STUDEBAKER!!
visi.com
More information about the Python-list
mailing list