replace __cmp__ for python3