def array(type_, count, data=None):
    """
    Generates a ctypes array of `type` with a length of `count`

    :param type_: A ctype type (ex: c_uint)
    :param count: The array length
    :param data: The initial data (optional)
    :return: The new type (if data is None) or a new array (if data is not None)
    """
    array_type = type_*count
    if data is None:
        return array_type
    else:
        return array_type(*data)