@classmethod
def _decode_var(cls, string):
    """ Decodes a given string into the appropriate type in Python.

        :param str string: The string to decode
        :return: The decoded value
        """
    str_match = cls.quoted_string_regex.match(string)
    if str_match:
        return string.strip("'" if str_match.groups()[0] else '"')
    elif string.isdigit() and cls.is_digit_regex.match(string) is not None:
        return int(string)
    elif string.lower() in ('true', 'false'):
        return string.lower() == 'true'
    elif string.lstrip('-').isdigit():
        try:
            return int(string)
        except ValueError:
            return string
    elif '.' in string.lstrip('-'):
        try:
            return float(string)
        except ValueError:
            return string
    else:
        return string
