Comparing strings with ints in Python 2.7.2 looks very incompatible:
x = '12'; y = 3
print x > y
x = 12; y = '3'
print x > y
According
How does Python compare string and int? in Python 3, this will throw an exception. Is there a way to make Python 2 already behave like this? Looking at __future__I could not understand if there is such an opportunity.
source
share