Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created April 24, 2013 06:32
Show Gist options
  • Save yuuichi-fujioka/5450057 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/5450057 to your computer and use it in GitHub Desktop.
reflection examples for function
def my_func(hoge,fuga,name='scot'):
'''comment message'''
print my_func.func_code.co_varnames # ('hoge', 'fuga', 'name')
print my_func.func_name # my_func
hoge_func = my_func
print hoge_func.func_code.co_name # my_func
print my_func.func_code.co_argcount # 3
print hoge_func.func_defaults # ('scot',)
print my_func.func_doc # 'comment message'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment