'1' + 1 ==> True ???

Erik Max Francis max at alcyone.com
Thu Mar 18 00:31:41 EST 2004


Nicola Mingotti wrote:

> Here i was looking for what you told me , so something like :
> x.__gt__(y) <==> x>y if x and y are numeric object , 
> every string is greater than every number (ErrorObject ,
> user define class ... ??) ...

You're guaranteed there will be some ordering between types, but you
don't know what it is, and it might vary from implementation to
implementation.  That is, for example, on a given implementation, either
all strs will be greater than ints, or all ints will be greater than
strs, but you shouldn't rely on either behavior.

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ The color is red / Under my shoe
    -- Neneh Cherry



More information about the Python-list mailing list