# Path: infi/pyutils/python_compat.py
# _PYTHON_VERSION = platform.python_version()
# _IS_PYTHON_3 = _PYTHON_VERSION >= '3'
# _IS_BELOW_PYTHON_2_7 = _PYTHON_VERSION < '2.7'
# def get_underlying_function(f):
# def _get_underlying_classmethod_function(f):
#     def create_bound_method(func, self):
#     class TemporaryClass(object):


from packaging.version import Version, parse
from .python_compat import OrderedDict, itervalues

ALL = '0.0'

class UnboundException(AttributeError):
    pass

def _convert(version):
    if version is None:
        return None
    if not isinstance(version, Version):
        return parse(version)
    return version

class VersionedBase(object):
    def __init__(self, version=ALL):
        self._version = _convert(version)

    def as_version(self, version):
        bound = self._copy()
        bound.bind_to_version(version)
        return bound


# Path: infi/pyutils/python_compat.py
# _PYTHON_VERSION = platform.python_version()
# _IS_PYTHON_3 = _PYTHON_VERSION >= '3'
# _IS_BELOW_PYTHON_2_7 = _PYTHON_VERSION < '2.7'
# def get_underlying_function(f):
# def _get_underlying_classmethod_function(f):
#     def create_bound_method(func, self):
#     class TemporaryClass(object):


# Path: infi/pyutils/enums.py
from packaging.version import Version, parse
from .python_compat import OrderedDict, itervalues


ALL = '0.0'

class UnboundException(AttributeError):
    pass

def _convert(version):
    if version is None:
        return None
    if not isinstance(version, Version):
        return parse(version)
    return version

class VersionedBase(object):
    def __init__(self, version=ALL):
        self._version = _convert(version)

    def as_version(self, version):
        bound = self._copy()
        bound.bind_to_version(version)
        return bound


    def bind_to_version(self, version):