The purpose of my question is to strengthen my knowledge base with Python and get a better picture of it, which includes knowing its faults and surprises. To keep things sp
Python 2 has some surprising behaviour with comparisons:
>>> print x 0 >>> print y 1 >>> x < y False
What's going on? repr() to the rescue:
repr()
>>> print "x: %r, y: %r" % (x, y) x: '0', y: 1