nomeyer
5/30/2016 - 12:25 PM

Method to be able to call dict() on Python objects and get a dictionary of attribute values

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)