def convert_string ( string ) : if is_int ( string ) : return int ( string ) elif is_float ( string ) : return float ( string ) elif convert_bool ( string ) [ 0 ] : return convert_bool ( string ) [ 1 ] elif string == 'None' : return None else : return string
python distinguish string float and string string
Convert string to int float or bool .
def convert_string(string):
    """Convert string to int, float or bool.
    """
    if is_int(string):
        return int(string)
    elif is_float(string):
        return float(string)
    elif convert_bool(string)[0]:
        return convert_bool(string)[1]
    elif string == 'None':
        return None
    else:
        return string