Is 0 > None?? (fwd)

Alex Martelli aleax at aleax.it
Mon Sep 3 07:32:23 EDT 2001


"Lulu of the Lotus-Eaters" <mertz at gnosis.cx> wrote in message
news:mailman.999290628.20638.python-list at python.org...
> "Alex Martelli" <aleax at aleax.it> wrote:
> |This used to make a lot of sense, but now it all breaks down
> |if any item in the heterogeneous list is a complex number, so
    ...
> |I think we could count this among Python's relatively-new
> |warts, actually:-).
>
> Don't forget about Unicode strings, which have the same problem.

Uh, DO they...?

D:\>python
Python 2.1.1c1 (#19, Jul 13 2001, 00:25:06) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
Alternative ReadLine 1.4 -- Copyright 2001, Chris Gonnerman
>>> u'ciao'>u'ciaó'
0
>>> u'ciao'<u'ciaó'
1
>>> 'ciao'<u'ciaó'
1
>>> 'ciao'>u'ciaó'
0
>>> import sys
>>> sys.getdefaultencoding()
'ascii'
>>>

It seems to me that nothing bad is happening (even with the
debatable choice of 'ascii' as the default encoding, which
I've restored for the purpose of this test from the latin-1
I normally use in my sitecustomize.py -- I thought your
observation might stem from such issues).  I must be
missing something here.


> As warts go, I find this one worse than anything else in Python (except
> maybe 'print >>').
>
> There is no good reason that Python 2.2 or 2.3 couldn't fix this wart.
> But it's not clear whether the BDFL will, in fact, let it be fixed.

Which wart are you referring to?  I don't see one regarding
Unicode strings.  I _do_ see one regarding complex numbers
and the sorting of heterogeneous lists -- there is something
weird in being able to sort a list made up of a plain string,
a Unicode string, an integer, a float, a list, an array, a
tuple, and a partridge in a pear tree... then have the whole
"heterogeneous sorts just work" caboodle crumble down when a
complex number is added to the mix...


Alex






More information about the Python-list mailing list