Skip to content

Instantly share code, notes, and snippets.

@tomoh1r
Created November 23, 2015 13:04
Show Gist options
  • Save tomoh1r/dd941686a9fff7e8ae32 to your computer and use it in GitHub Desktop.
Save tomoh1r/dd941686a9fff7e8ae32 to your computer and use it in GitHub Desktop.
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