summaryrefslogtreecommitdiff
path: root/semantic_version/compat.py
blob: b17468fd3f5b7ea6266a95af3e8e4a5b684f75c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- coding: utf-8 -*-
# Copyright (c) The python-semanticversion project
# This code is distributed under the two-clause BSD License.


def base_cmp(x, y):
    if x == y:
        return 0
    elif x > y:
        return 1
    elif x < y:
        return -1
    else:
        # Fix Py2's behavior: cmp(x, y) returns -1 for unorderable types
        return NotImplemented