by derriz · 5y ago · 0 comments
# Uses 3-way cmp() for primitives
def cmp3(a, b):
if not isinstance(a, list):
global c; c += 1
return cmp(a, b)
for x, y in zip(a, b):
r = cmp3(x, y)
if r != 0:
return r
return 0
This isn't generally the expected behaviour for comparing lists, surely?