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

Nicola Mingotti bla at libero.it
Wed Mar 17 21:45:56 EST 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