Skip to content

Instantly share code, notes, and snippets.

@jasisz

jasisz/heisenbug Secret

Last active March 29, 2017 07:25
Show Gist options
  • Save jasisz/485589e842bdfa7f4116c2f3591d05a4 to your computer and use it in GitHub Desktop.
Save jasisz/485589e842bdfa7f4116c2f3591d05a4 to your computer and use it in GitHub Desktop.
functions = []
def fancy_decorator(name):
def wrapper(func):
func.name = name
print('Registering func with name {}'.format(name))
functions.append(func)
return func
return wrapper
def single_handler():
pass
for n in ['one', 'two', 'three']:
fancy_decorator(n)(single_handler)
for f in functions:
print(f.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment