Reputation: 2472
I am looking for something along the lines of dir()
, but want to filter out non-instancemethods and attributes that are defined in super class/es.
Upvotes: 0
Views: 91
Reputation: 184455
for python 2.x:
[name for name, method in Class.__dict__.iteritems() if callable(method)]
for python 3.x:
[name for name, method in Class.__dict__.items() if hasattr(method,'__call__')]
Upvotes: 4