Analyzing Objects in Python
There’s a built-in Python function called vars that can be useful in analyzing a Python object. Just as running dir(the_object) returns a listing of all of the attributes of an object, including it’s methods, the following code, will return key/value pairs for the named attributes (variables), but NOT the methods (functions): for k, v in … Continued