'20' <= 100

HP hp at rentec.com
Thu May 1 17:58:00 EDT 2003


I have a statement somewhere in the code that
boils down to comparing a string object with an integer.
i.e.  var1 <= var2
where var1 = '20' and var2 = 100

The code runs ok but the above comparison always return 0 !!

It took me quite an effort to finally pin it down.

Is it the programmer's responsibility to check the 
type of var1 and var2 before using <=   ???

--HP




More information about the Python-list mailing list