How to get list of methods in a Python class?

Posted by Jessica Taylor | Updated on

If you want to get list of methods in a Python class? An example (listing the methods of the optparse.OptionParser class):

Notice that getmembers returns a list of 2-tuples. The first item is the name of the member, the second item is the value.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers