Method to be able to call dict() on Python objects and get a dictionary of attribute values
def __iter__(self): for attr, value in self.__dict__.iteritems(): yield (attr, value)