[pypy-svn] r46475 - in pypy/dist/pypy: module/_weakref/test objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Sep 11 17:27:37 CEST 2007


Author: cfbolz
Date: Tue Sep 11 17:27:36 2007
New Revision: 46475

Modified:
   pypy/dist/pypy/module/_weakref/test/test_weakref.py
   pypy/dist/pypy/objspace/std/setobject.py
Log:
enable taking weakrefs of sets


Modified: pypy/dist/pypy/module/_weakref/test/test_weakref.py
==============================================================================
--- pypy/dist/pypy/module/_weakref/test/test_weakref.py	(original)
+++ pypy/dist/pypy/module/_weakref/test/test_weakref.py	Tue Sep 11 17:27:36 2007
@@ -209,7 +209,6 @@
         assert w_bound() is None
 
     def test_set_weakrefable(self):
-        skip("missing: weakrefs to interp-level sets")
         import _weakref, gc
         s = set([1, 2, 3, 4])
         w = _weakref.ref(s)

Modified: pypy/dist/pypy/objspace/std/setobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/setobject.py	(original)
+++ pypy/dist/pypy/objspace/std/setobject.py	Tue Sep 11 17:27:36 2007
@@ -29,6 +29,12 @@
             obj = space.call_function(space.type(w_self),itemiterator)
         return obj
 
+    _lifeline_ = None
+    def getweakref(self):
+        return self._lifeline_
+    def setweakref(self, space, weakreflifeline):
+        self._lifeline_ = weakreflifeline
+
 class W_SetObject(W_BaseSetObject):
     from pypy.objspace.std.settype import set_typedef as typedef
 



More information about the Pypy-commit mailing list