Variables and functions of an object
You are using a library and a function returns an object. What kind of object is it? What variables does it have? What functions does it have? You would like to investigate this object you received.
I came up with the following methods:
from pprint import pprint def print_variables_of(obj): """variables of an object""" pprint (vars(obj)) def print_callables_of(obj): """callables (functions too) of an object""" li =  for name in dir(obj): attr = getattr(obj, name) if hasattr(attr, '__call__'): li.append(name) pprint(li)
The first one prints the variables of an object, while the second one prints the callables (functions fall in this category) of the object.