Commit 7a0b03b7 authored by Andreas Zeidler's avatar Andreas Zeidler

backport r99191 to 2.10

parent b63cce10
......@@ -822,7 +822,7 @@ Wrapper_contains(Wrapper *self, PyObject *v)
static PyObject *
Wrapper_iter(Wrapper *self)
{
return CallMethodO(OBJECT(self), py__iter__, NULL, NULL);
return PyObject_GetIter(self->obj);
}
static PySequenceMethods Wrapper_as_sequence = {
......
......@@ -1719,6 +1719,26 @@ def test_proxying():
iterating...
[42]
Finally let's check that https://bugs.launchpad.net/zope2/+bug/360761
has been fixed:
>>> class C(Acquisition.Implicit):
... l=[1,2,3]
... def __getitem__(self, i):
... return self.l[i]
>>> c1 = C()
>>> type(iter(c1))
<type 'iterator'>
>>> list(c1)
[1, 2, 3]
>>> c2 = C().__of__(c1)
>>> type(iter(c2))
<type 'iterator'>
>>> list(c2)
[1, 2, 3]
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment