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=94905&r1=92577&r2=94905

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

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to