def autocast(s):
    """Try to guess the simple type and convert the value to it.

    @param s string
    @returns the relevant type : a float, string or int
    """
    try:
        return int(s)
    except ValueError:
        try:
            return float(s)
        except ValueError:
            return s
