How to use the boltons.funcutils.wraps function in boltons

To help you get started, we’ve selected a few boltons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mahmoud / boltons / tests / test_funcutils_fb.py View on Github external
        @wraps(func, injected=["b"])
        def wrapped(a, *args, **kwargs):
            return func(a, 2, *args, **kwargs)
        return wrapped
github mahmoud / boltons / tests / test_funcutils_fb_py37.py View on Github external
            @wraps(wrapped)
            async def decorator(*args, **kw):
                return (await wrapped(*args, **kw))
            return decorator
github mahmoud / boltons / tests / test_funcutils_fb.py View on Github external
        @wraps(func, update_dict=True)
        def wrapped(*args, **kwargs):
            return func(*args, **kwargs)
        return wrapped
github mahmoud / boltons / tests / test_funcutils_fb.py View on Github external
        @wraps(func)
        def cedar_wrapper(*a, **kw):
            return (flag, func.__name__, func(*a, **kw))
        return cedar_wrapper
github mahmoud / boltons / tests / test_funcutils_fb.py View on Github external
        @wraps(func, foo="bar")
        def wrapped(*args, **kwargs):
            return func(*args, **kwargs)
        return wrapped
github mahmoud / boltons / tests / test_funcutils_fb.py View on Github external
        @wraps(func, injected="c", inject_to_varkw=False)
        def wrapped(*args, **kwargs):
            return func(c=1, *args, **kwargs)
        return wrapped
github mahmoud / boltons / tests / test_funcutils_fb_py37.py View on Github external
        @wraps(func)
        async def wrapped(*args, **kw):
            await asyncio.sleep(1.0)
            return await func(*args, **kw)
github mahmoud / boltons / tests / test_funcutils_fb_py3.py View on Github external
        @wraps(func)
        def cedar_wrapper(*a, **kw):
            return (flag, func.__name__, func(*a, **kw))
        return cedar_wrapper
github bmabey / provenance / provenance / utils.py View on Github external
        @bfu.wraps(f)
        def _when_type(val):
            if isinstance(val, type):
                return f(val)
            else:
                return val
github couchbase / couchbase-python-client / couchbase / mutate_in.py View on Github external
    @wraps(func)
    def mutated(*args, **kwargs):
        result = func(*args, **kwargs)
        return get_mutation_result(result)