[pypy-commit] pypy reflex-support: o) merge default into branch
wlav
noreply at buildbot.pypy.org
Tue Jun 19 20:38:47 CEST 2012
Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r55720:9f6a3c12b789
Date: 2012-06-19 10:39 -0700
http://bitbucket.org/pypy/pypy/changeset/9f6a3c12b789/
Log: o) merge default into branch o) add UCB to copyright holders o)
document reflex-support addition in whatsnew
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -216,6 +216,7 @@
DFKI GmbH, Germany
Impara, Germany
Change Maker, Sweden
+ University of California Berkeley, USA
The PyPy Logo as used by http://speed.pypy.org and others was created
by Samuel Reis and is distributed on terms of Creative Commons Share Alike
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -8,6 +8,9 @@
.. branch: default
.. branch: app_main-refactor
.. branch: win-ordinal
+.. branch: reflex-support
+Provides cppyy module (disabled by default) for access to C++ through Reflex.
+See doc/cppyy.rst for full details and functionality.
.. "uninteresting" branches that we should just ignore for the whatsnew:
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
@@ -491,7 +491,8 @@
storage = self._difference_unwrapped(w_set, w_other)
elif not w_set.strategy.may_contain_equal_elements(w_other.strategy):
strategy = w_set.strategy
- storage = w_set.sstorage
+ d = self.unerase(w_set.sstorage)
+ storage = self.erase(d.copy())
else:
strategy = self.space.fromcache(ObjectSetStrategy)
storage = self._difference_wrapped(w_set, w_other)
@@ -776,6 +777,13 @@
def update(self, w_set, w_other):
d_obj = self.unerase(w_set.sstorage)
+
+ # optimization only
+ if w_other.strategy is self:
+ d_other = self.unerase(w_other.sstorage)
+ d_obj.update(d_other)
+ return
+
w_iterator = w_other.iter()
while True:
w_item = w_iterator.next_entry()
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
@@ -642,6 +642,21 @@
assert set([1,2,3,'5']).difference(set([2,3,4])) == set([1,'5'])
assert set().difference(set([1,2,3])) == set()
+ def test_difference_bug(self):
+ a = set([1,2,3])
+ b = set([])
+ c = a - b
+ c.remove(2)
+ assert c == set([1, 3])
+ assert a == set([1, 2, 3])
+
+ a = set([1,2,3])
+ b = set(["a", "b", "c"])
+ c = a - b
+ c.remove(2)
+ assert c == set([1, 3])
+ assert a == set([1, 2, 3])
+
def test_intersection_update(self):
s = set([1,2,3,4,7])
s.intersection_update([0,1,2,3,4,5,6])
More information about the pypy-commit
mailing list