Getting a list of an object's methods?

Gerrit Holl gerrit at
Sun Jun 22 17:49:10 CEST 2003

Alexander Schmolck wrote:
> Try
> >>> import inspect, operator
> >>> inspect.getmembers(foo, operator.isCallable)
> for a start (should come pretty close, although it will also give you callables
> that aren't methods). You'll have to check this for 2.1, but if I remember
> rightly it ough to work.

Note that operator.isCallable has been deprecated since Python 2.0. You
can simply use the callable() builtin function.


245. If any one hire oxen, and kill them by bad treatment or blows, he
shall compensate the owner, oxen for oxen.
        -- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering:
Het zijn tijden om je zelf met politiek te bemoeien:

More information about the Python-list mailing list