On Thu, Jan 14, 2010 at 10:13 AM, Stefan Behnel <[email protected]> wrote:
>
> Note that this won't work in Py3, where the "cmp" parameter is gone.
>
> Stefan
And he's right again. I should've checked for that. Well, that makes a
CmpInt class the only other solution:
class CmpInt(int):
def __lt__(self, other):
if isinstance(other, str): return True
return int.__lt__(self, other)
def __gt__(self, other):
if isinstance(other, str): return False
return int.__gt__(self, other)
Hugo
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor