13 Apr
2009
13 Apr
'09
9:22 a.m.
Chris Withers wrote:
If you try and iterate over an instance of this class, you get an AttributeError: __iter__. This doesn't make a lot of sense, since you *don't* get an error like that if you iterate over an instance of:
class X: def __getitem__(self,i): return 1
The change you are interested in is probably: http://svn.zope.org/Zope/trunk/lib/python/Acquisition/_Acquisition.c?rev=949... Acquisition now proxy real iteration via __iter__ correctly (it didn't do that before). What is missing from that change is probably the fallback to the __getitem__ protocol, in case the class isn't a real iterator. Hanno