Introspection in python

Introspection in python

Imagine that you are debugging and that you want to know the methods that you can call on an object, this pseudo code can be helpful. Here "some_object" is any python object:

[method for method in dir(some_object) if callable(getattr(some_object, method))]



Comments powered by Disqus