def f(i): ... if x < i: ...
The problem is, no error will be thrown if 'i' is, say, a string:
py> 1 < 'a' True py> 10000000000 < 'a' True
But for my code, passing a string is bad, so I'd like to provide an appropriate error.
I thought about calling int() on the value, but this will also allow some strings (e.g. '1'). I guess this isn't horrible, but it seems somewhat suboptimal...
Ideas?
Steve -- http://mail.python.org/mailman/listinfo/python-list