I noticed a Python script I was writing was acting squirrelly, and traced it to an infinite loop, where the loop condition was "while line is not ''". Running through it ...
In python 3, int(50)<'2' causes a TypeError, and well it should. In python 2.x, however, int(50)<'2' returns True (this is also the case for other number formats, but int exists ...
What's the most efficient way to compare two python values both of which are probably strings, but might be integers. So far I'm using str(x)==str(y) but that feels inefficient: