class Thing(object):

    def __init__(self):
        self.tint = 'black'
self.color = 'red'
self.taste = 'tangy'
thing = Thing()
dictionary_from_class = {}
for key in list(thing.__dict__.keys()):
    dictionary_from_class[key] = thing.__dict__[key]
Significance of double underscores in Python filename