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

Nicola Mingotti bla at libero.it
Thu Mar 18 03:45:56 CET 2004


Hi , 

I obtained this result : 
------
>>> '1' > 1 
True
------
with python2.2.3 and 2.3.3 .
(Yes , in python 2.2 i get 1 instead of True)

but 
------
>>> '1' + 1
TypeError 
-------

and 
-----------------------------
>>>'1'.__gt__.__doc__
'x.__gt__(y) <==> x>y'
-----------------------------

so i'm a little puzzled :)

Is this a bug or is there a very good reason 
to this strange behaviour ? 

Thank you all .

bye .

(Please forgive english mistakes)
 




More information about the Python-list mailing list