Lines Matching refs:wrapper

3 # Python module wrapper for _functools C module
30 # wrapper functions that can handle naive introspection
35 def update_wrapper(wrapper,
39 """Update a wrapper function to look like the wrapped function
41 wrapper is the function to be updated
44 from the wrapped function to the wrapper function (defaults to
46 updated is a tuple naming the attributes of the wrapper that
56 setattr(wrapper, attr, value)
58 getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
61 wrapper.__wrapped__ = wrapped
62 # Return the wrapper so this can be used as a decorator via partial()
63 return wrapper
68 """Decorator factory to apply update_wrapper() to a wrapper function
71 function as the wrapper argument and the arguments to wraps() as the
458 its hash value, then that argument is returned without a wrapper. This
511 wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
512 wrapper.cache_parameters = lambda : {'maxsize': maxsize, 'typed': typed}
513 return update_wrapper(wrapper, user_function)
519 wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
520 wrapper.cache_parameters = lambda : {'maxsize': maxsize, 'typed': typed}
521 return update_wrapper(wrapper, user_function)
542 def wrapper(*args, **kwds):
551 def wrapper(*args, **kwds):
566 def wrapper(*args, **kwds):
637 wrapper.cache_info = cache_info
638 wrapper.cache_clear = cache_clear
639 return wrapper
904 def wrapper(*args, **kw):
913 wrapper.register = register
914 wrapper.dispatch = dispatch
915 wrapper.registry = types.MappingProxyType(registry)
916 wrapper._clear_cache = dispatch_cache.clear
917 update_wrapper(wrapper, func)
918 return wrapper