I have a class as such below. However, the attribute names remain unknown. How, under this circumstance, do a make a class iterator? Basic examples point to __iter__ and next() having some knowledge of the class's attributes as does the example in the pydocs.
class Foo(object):
def __init__(self, dictionary):
for k, v in dictionary.iteritems():
setattr(self, k, v)
I would like to iterate through each object attribute something like so:
bar = Foo(dict)
for i in bar:
bar[i]