from typing import OrderedDict
import six


def _guess_enum_val_type(stringy_val):
    """
    Helper function to guess the type of values in an enum are.

    At this point it tries int, float, and complex and then assumes it is
    a string.

    Parameters
    ----------
    stringy_val : str
        The value to guess the type of

    Returns
    -------
    type_str : {'int', 'float', 'complex', 'str'}
        The guessed type as a string.
    """
    od = OrderedDict()
    od['int'] = int
    od['float'] = float
    od['complex'] = complex

    for k, v in six.iteritems(od):
        try:
            v(stringy_val)
            return k
        except ValueError:
            pass
    # give up and assume it is a string
    return 'str'