[Python-3000] None in Comparisons

M.-A. Lemburg mal at egenix.com
Tue Nov 11 15:21:03 CET 2008


On 2008-11-11 15:07, Barry Warsaw wrote:
> On Nov 11, 2008, at 8:54 AM, M.-A. Lemburg wrote:
> 
>> On 2008-11-11 14:28, Antoine Pitrou wrote:
>>> M.-A. Lemburg <mal <at> egenix.com> writes:
>>>> Why was the special case for None being "smaller" than all other
>>>> objects in Python removed from Python 3.0 ? (see object.c in Py2.x)
>>>
>>> Because ordered comparisons (<, <=, >, >=) are much stricter in 3.0
>>> than in 2.x.
>>> In practice, ordered comparisons which don't have an obvious,
>>> intuitive meaning
>>> now raise a TypeError (such as comparing a number and a string).
> 
>> That's fine. I'm just talking about the special case for None that
>> has existed in Python for years - and for a good reason.
> 
> How hard is it to implement your own "missing" object which has the
> desired semantics?  Why should something as fundamental as None have it?

Because None is already special, has had this feature for a very
long time and there's no apparent reason to move the feature to
some other special object.

Also, having each module or project invent its own NULL-like
object will not make things better for anyone, it would only
introduce new problems.

I don't see any benefit from the removal of the special property
of None in Python 3.0.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 11 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


More information about the Python-3000 mailing list