Skip to content

Commit

Permalink
backport r99191 to 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
witsch committed Apr 15, 2009
1 parent 5b97540 commit 76fefe3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _Acquisition.c
Expand Up @@ -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 = {
Expand Down
20 changes: 20 additions & 0 deletions tests.py
Expand Up @@ -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]
"""


Expand Down

0 comments on commit 76fefe3

Please sign in to comment.