import functools


def xpartial(func, *args, **kw):
    """Augment partial to make it possible to register partials as view callables.

    >>> f = xpartial(lambda x, y: x + y, 1)
    >>> assert f(1) == 2
    """
    res = functools.partial(func, *args, **kw)
    res.__module__ = func.__module__
    return res