I actually just created this, but I think it's going to be a very useful debugging tool.
def dirValues(instance, all=False):
retVal = {}
for prop in dir(instance):
if not all and prop[1] == "_":
continue
retVal[prop] = getattr(instance, prop)
return retVal
I usually use dir() in a pdb context, but I think this will be much more useful:
(pdb) from pprint import pprint as pp
(pdb) from myUtils import dirValues
(pdb) pp(dirValues(someInstance))