(seq, tp)
Create a C structure or array of type ``tp``, initialized with values from ``seq``.

    If ``tp`` is a :class:`~ctypes.Structure` type, the newly created structure's fields are initialized in declaration
    order with the values from ``seq``. ``seq`` must have as many elements as the structure has fields.

    If ``tp`` is a :class:`~ctypes.Array` type, the newly created array is initialized with the values from ``seq``.
    ``seq`` must have as many elements as the array type.

    In both cases, if a structure field type or the array element type is itself a structure or array type, the
    corresponding value from ``seq`` is recursively converted as well.
Create a C structure or array of type ``tp``, initialized with values from ``seq``.
Create a C structure or array of type tp initialized with values from seq .
def compound_value_for_sequence(seq, tp):
    """Create a C structure or array of type ``tp``, initialized with values from ``seq``.

    If ``tp`` is a :class:`~ctypes.Structure` type, the newly created structure's fields are initialized in declaration
    order with the values from ``seq``. ``seq`` must have as many elements as the structure has fields.

    If ``tp`` is a :class:`~ctypes.Array` type, the newly created array is initialized with the values from ``seq``.
    ``seq`` must have as many elements as the array type.

    In both cases, if a structure field type or the array element type is itself a structure or array type, the
    corresponding value from ``seq`` is recursively converted as well.
    """

    if issubclass(tp, Structure):
        return _struct_for_sequence(seq, tp)
    elif issubclass(tp, Array):
        return _array_for_sequence(seq, tp)
    else:
        raise TypeError("Don't know how to convert a sequence to a {tp.__module__}.{tp.__qualname__}".format(tp=tp))
def compound_value_for_sequence ( seq , tp ) : if issubclass ( tp , Structure ) : return _struct_for_sequence ( seq , tp ) elif issubclass ( tp , Array ) : return _array_for_sequence ( seq , tp ) else : raise TypeError ( "Don't know how to convert a sequence to a {tp.__module__}.{tp.__qualname__}" . format ( tp = tp ) )