Skip to content

Instantly share code, notes, and snippets.

@tomoh1r
Created Nov 23, 2015
Embed
What would you like to do?
decorator でラップされた対象を控えておく
>>> lst = []
>>> def deco(f):
... lst.append(f)
...
>>> @deco
... def main():
... pass
...
>>> print(['{f.__module__}.{f.__name__}'.format(f=f) for f in lst])
['__main__.main']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment