Last active
December 18, 2017 06:29
-
-
Save Nnwww/302431fb7d698ce12ba15764815f1c26 to your computer and use it in GitHub Desktop.
A function added inspect.getmember to obtaining method's signatures.
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
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) |
(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
e.g. enumerate all methods of a
Synset
instance in wordnet.