import attr


def ListParameter(default=None, factory=list, **kwargs):
    """Adds a list parameter.

    Args:
        default (optional, list): Default value. Default: None.
        base (optional, callabe): Factory function, e.g. list
            or tuple. Default: list.
    """
    if default is not None:
        return attr.ib(default, **kwargs)
    return attr.ib(factory=factory, **kwargs)