On 2008-11-12 00:09, Antoine Pitrou wrote:
> M.-A. Lemburg <mal <at> egenix.com> writes:
>>>>> None > None
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> TypeError: unorderable types: NoneType() > NoneType()
>>>>> None != None
>> False
>>
>> Two values that compare equal to each other (and are in fact identical),
>> yet cannot be compared less-than or greater-than.
> 
> The error message is clear: "unorderable types". Having some types support an
> equivalence relation (e.g. "equality") but no intuitive total order relation 
> is
> hardly a surprise. As someone said, complex numbers are an example of that 
> (not
> only in Python, but in real life).

The difference is that None is a singleton, so the set of all
None type instances is {None}. You always have an intuitive total order
relation on one element sets: the identity relation.

>> This would make sense if you think of None as meaning "anything
>> and/or nothing", since the left side None could stand for
>> a different None than the right one, but then you could apply the
>> same logic to inf:
> 
> inf is a float instance, and as such supports ordering. I don't see how it
> invalidates None *not* supporting an order relation, since None isn't a float
> instance and doesn't pretend to be usable as a number (or as anything 
> supporting
> ordering, for that matter).

Right, but you're taking the view of a CPython developer. You
need to view this as Python user.

In real (math) life, inf is a different type of number than regular floats,
ints or complex numbers and has a special meaning depending on the context
in which you use it. The relationship is much like that of None to all
other Python objects.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 12 2008)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to