Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created August 2, 2013 10:03
Show Gist options
  • Save yuuichi-fujioka/6138811 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/6138811 to your computer and use it in GitHub Desktop.
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))
import inspect
inspect.getsource(hoge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment