def __deserialize_primitive(A, data, klass):
    """Deserializes string to primitive type.

        :param data: str.
        :param klass: class literal.

        :return: int, long, float, str, bool.
        """
    assert type(data) == klass
    return data
