def test_reversed_mutation(self):
    n = 10
    d = range(n)
    it = reversed(d)
    next(it)
    next(it)
    assert (it.__length_hint__() == (n - 2))
    d.append(n)
    assert (it.__length_hint__() == (n - 2))
    d[1:] = []
    assert (it.__length_hint__() == 0)
    assert (list(it) == [])
    d.extend(xrange(20))
    assert (it.__length_hint__() == 0)
def test_reversed_mutation(self):
    n = 10
    d = range(n)
    it = reversed(d)
    next(it)
    next(it)
    assert (it.__length_hint__() == (n - 2))
    d.append(n)
    assert (it.__length_hint__() == (n - 2))
    d[1:] = []
    assert (it.__length_hint__() == 0)
    assert (list(it) == [])
    d.extend(xrange(20))
    assert (it.__length_hint__() == 0)