Created
November 23, 2015 13:04
-
-
Save tomoh1r/dd941686a9fff7e8ae32 to your computer and use it in GitHub Desktop.
decorator でラップされた対象を控えておく
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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