Skip to content

Instantly share code, notes, and snippets.

View arcsector's full-sized avatar
🎅

arcsector arcsector

🎅
View GitHub Profile
@arcsector
arcsector / meta_wrapper.py
Last active November 6, 2019 07:10
Meta-wrappers are wrappers within wrappers; these allow for nested decorators and nested wrappers
from functools import wraps
# the f argument is a function that we pass
def base_wrapper(f):
# you need this in all wrappers/decorators
@wraps(f)
# the *args and **kwargs allow for passing
# arguments into the wrapped function;
# notice how we define a function within a
# function with a return value, and then