Skip to content

Instantly share code, notes, and snippets.

@Nnwww
Last active December 18, 2017 06:29
Show Gist options
  • Save Nnwww/302431fb7d698ce12ba15764815f1c26 to your computer and use it in GitHub Desktop.
Save Nnwww/302431fb7d698ce12ba15764815f1c26 to your computer and use it in GitHub Desktop.
A function added inspect.getmember to obtaining method's signatures.
import inspect
def getobjinfos(obj, pred=lambda a: True):
for symbolstr, value in inspect.getmembers(obj, pred):
yield (value, symbolstr , inspect.signature(value)) if inspect.ismethod(value) else (value, symbolstr)
@Nnwww
Copy link
Author

Nnwww commented Dec 18, 2017

(To read documents, you can use help().)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment