Can ask a class for its functions?
troy at gci.net
Wed Aug 14 21:43:51 EDT 2002
This doesn't work because dir() returns a list of strings, none of which are
What you meant was:
filter(callable, [getattr(class_, attr) for attr in dir(class_)])
Carl Banks wrote:
> Matt Gerrans wrote:
>> Yes, you can use dir(classname) or you can access its dictionary like so:
> Otherwise, you get stuff that isn't methods.
mailto:troy at gci.net
More information about the Python-list