def test_iter_getitem(self):

    class C(object):

        def __getitem__(self, i):
            return range(2)[i]
    assert (list(C()) == range(2))
def test_iter_getitem(self):

    class C(object):

        def __getitem__(self, i):
            return range(2)[i]
    assert (list(C()) == range(2))