http://python-future.org/compatible_idioms.html?highlight=cmp#cmp recommends
cmp = lambda(x, y): (x > y) - (x < y) but that is a SyntaxError in Python 3.6...
python3 -c 'cmp = lambda(x, y): (x > y) - (x < y)' # --> SyntaxError
What is the correct approach?
http://python-future.org/compatible_idioms.html?highlight=cmp#cmp recommends
cmp = lambda(x, y): (x > y) - (x < y)but that is a SyntaxError in Python 3.6...python3 -c 'cmp = lambda(x, y): (x > y) - (x < y)'# --> SyntaxErrorWhat is the correct approach?