[Bengt Richter] > I'm not sure, but I think it may be expedient optimization practicality beating purity.
It is more a matter of coping with the limitations of the legacy API where want to wrap a sequence iterator around __getitem__ in sequences but not in mappings. > <snipped code experiments> > I haven't walked the relevant iter() code. > That would be too easy ;-) The actual code for Object/abstract.c's PyObject_GetIter() is somewhat more straight-forward and less mysterious than those experiments suggest. Raymond -- http://mail.python.org/mailman/listinfo/python-list