import functools


def partial(f, *args, **kwargs):
    """
    Create partial while preserving __name__ and __doc__.

    :param f: function
    :type f: callable
    :param args: arguments
    :type args: dict
    :param kwargs: keyword arguments
    :type kwargs: dict
    :return: partial
    :rtype: callable
    """
    p = functools.partial(f, *args, **kwargs)
    functools.update_wrapper(p, f)
    return p