Author: Lukas Diekmann <lukas.diekm...@uni-duesseldorf.de> Branch: set-strategies Changeset: r49222:64702787279f Date: 2011-10-11 14:49 +0200 http://bitbucket.org/pypy/pypy/changeset/64702787279f/
Log: added test and fix for update on empty sets diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py --- a/pypy/objspace/std/setobject.py +++ b/pypy/objspace/std/setobject.py @@ -285,7 +285,7 @@ def update(self, w_set, w_other): w_set.strategy = w_other.strategy - w_set.storage = w_other.get_storage_copy() + w_set.sstorage = w_other.get_storage_copy() def iter(self, w_set): return EmptyIteratorImplementation(self.space, w_set) diff --git a/pypy/objspace/std/test/test_setobject.py b/pypy/objspace/std/test/test_setobject.py --- a/pypy/objspace/std/test/test_setobject.py +++ b/pypy/objspace/std/test/test_setobject.py @@ -324,6 +324,9 @@ s1 = set('abc') s1.update('d', 'ef', frozenset('g')) assert s1 == set('abcdefg') + s1 = set() + s1.update(set('abcd')) + assert s1 == set('abcd') def test_recursive_repr(self): class A(object): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit