This is another huge trap I've met today.
I spend hours on debugging my code and finally I found it caused by this weird setting
Below is my python prompt interface
'3' > '2'
True
'4' > '3'
True
'15' > '11'
True
'999233' > '123'
True
# At this point, you must think compare string numbers is just like compare numbers.
# Me too, but...
'5' > '15'
True
# What's this !!!???
# Meanwhile I am asking this question. I want to something exaggerated to mockerying
# this mechanism, and I find something surprised me:
'5' > '999233'
False
# What!!!???
# Suddenly an idea come across my mind, are they comparing the first string number
# at first, if they are equal and then compare the second one?
# So I tried:
'5' > '13333333333333333'
True
'5' > '61'
False
# That's it.
# my old doubt disappeared and a new question raised:
Why they designed such a mechanism instead of use natural number comparison mechanism? What's the benefit to use this mechanism in "string number" comparison?