L = [[getattr(self, attr), attr] for attr in dir(self) if not attr.startswith("__")]
>>> [a for a in dir(obj) if not a.startswith('__')]
['bar', 'foo', 'func']
class C:
a = 5
b = [1,2,3]
def foobar():
b = "hi"
for attr, value in C.__dict__.iteritems():
print "Attribute: " + str(attr or "")
print "Value: " + str(value or "")