Created
August 2, 2013 10:03
-
-
Save yuuichi-fujioka/6138811 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import inspect | |
def get_org_func(f): | |
if hasattr(f.__closure__, 'count') : | |
for v in f.__closure__: | |
if inspect.isfunction(v.cell_contents): | |
return get_org_func(v.cell_contents) | |
else: | |
return f | |
inspect.getsource(get_org_func(hoge)) |
This file contains hidden or 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
import inspect | |
inspect.getsource(hoge) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment