On Mon, Jan 9, 2012 at 4:30 PM, david.gar...@gmail.com <david.gar...@gmail.com> wrote: > Chris, > > Both a list and dict are both iterable. I get a python dictionary object of > both iterables.;) It is nice... but I don't know if this is good form? > Should I be asking the duck question here? >>>> print helo.__dict__ [SNIP]
I think you're confused, which is probably why your question is so confusing. helo.__dict__ has nothing to do with iterables or the __iter__ method of your class. This is just the instance dictionary of the "helo" object, which contains all the attributes stored on that object. I'm still not sure exactly what it is that you're asking whether it is "good form"? I also don't know what the "duck question" is -- I presume you're referring to duck typing ("Does it quack like a duck?"), but I don't see how that is relevant to the code you posted. Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list