[lang-ref] ( sort_func_helper ) ( python )

def test_sort_func_helper():
    # cmp(a, b) is not available in Python 3.
    # Note: It existed in Python 2.

    def cmp(a, b):
        return (a > b) - (a < b)

    assert cmp(3, 4) == -1
    assert cmp(4, 4) ==  0
    assert cmp(4, 3) ==  1