Author: Hakan Ardo <ha...@debian.org> Branch: Changeset: r47723:631873ac63b7 Date: 2011-09-30 20:02 +0200 http://bitbucket.org/pypy/pypy/changeset/631873ac63b7/
Log: a setslice mutates the array diff --git a/pypy/annotation/test/test_annrpython.py b/pypy/annotation/test/test_annrpython.py --- a/pypy/annotation/test/test_annrpython.py +++ b/pypy/annotation/test/test_annrpython.py @@ -3204,6 +3204,8 @@ s = a.build_types(f, []) assert isinstance(s, annmodel.SomeList) assert not s.listdef.listitem.resized + assert not s.listdef.listitem.immutable + assert s.listdef.listitem.mutated def test_delslice(self): def f(): diff --git a/pypy/annotation/unaryop.py b/pypy/annotation/unaryop.py --- a/pypy/annotation/unaryop.py +++ b/pypy/annotation/unaryop.py @@ -352,6 +352,7 @@ check_negative_slice(s_start, s_stop) if not isinstance(s_iterable, SomeList): raise Exception("list[start:stop] = x: x must be a list") + lst.listdef.mutate() lst.listdef.agree(s_iterable.listdef) # note that setslice is not allowed to resize a list in RPython _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit