Did I find the right examples for you? yes no

All Samples(123)  |  Call(122)  |  Derive(0)  |  Import(1)
getweakrefs(object) -- return a list of all weak reference objects
that point to 'object'.

src/g/o/gogreen-1.0.1/gogreen/coroqueue.py   gogreen(Download)
	def __dealloc(self, o):
		for r in weakref.getweakrefs(o):
			self._item_refs.pop(r, None)
 
	def _stop_info(self, data):

src/g/o/gogreen-HEAD/gogreen/coroqueue.py   gogreen(Download)
    def __dealloc(self, o):
        for r in weakref.getweakrefs(o):
            self._item_refs.pop(r, None)
 
    def _stop_info(self, data):

src/g/e/ges-python-HEAD/lib/python2.6/reimport.py   ges-python(Download)
def _swap_refs(old, new, ignores):
    """Swap references from one object to another"""
    __internal_swaprefs_ignore__ = "swap_refs"    
    # Swap weak references
    refs = weakref.getweakrefs(old)

src/r/e/reimport-1.3/reimport.py   reimport(Download)
def _swap_refs(old, new, ignores):
    """Swap references from one object to another"""
    __internal_swaprefs_ignore__ = "swap_refs"    
    # Swap weak references
    refs = weakref.getweakrefs(old)

src/l/d/ldapdict-1.4/mrucache.py   ldapdict(Download)
 
import gc
from weakref import WeakValueDictionary, getweakrefcount, getweakrefs
 
class MRUCache(WeakValueDictionary, object):

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/test/test_weakref.py   main(Download)
        ref2 = weakref.ref(o, self.callback)
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [ref2],
                     "list of refs does not match")
 
        o = C()
        ref1 = weakref.ref(o, self.callback)
        ref2 = weakref.ref(o, self.callback)
        del ref2
        self.assertTrue(weakref.getweakrefs(o) == [ref1],
 
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [],
                     "list of refs not cleared")
 
        # assumes ints do not support weakrefs
        self.assertTrue(weakref.getweakrefs(1) == [],
        r2 = weakref.ref(o)
        self.assertTrue(r1 is not r2)
        self.assertEqual(weakref.getweakrefs(o), [r2, r1])
        self.assertEqual(weakref.getweakrefcount(o), 2)
        r3 = MyRef(o)

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_weakref.py   main(Download)
        ref2 = weakref.ref(o, self.callback)
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [ref2],
                     "list of refs does not match")
 
        o = C()
        ref1 = weakref.ref(o, self.callback)
        ref2 = weakref.ref(o, self.callback)
        del ref2
        self.assertTrue(weakref.getweakrefs(o) == [ref1],
 
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [],
                     "list of refs not cleared")
 
        # assumes ints do not support weakrefs
        self.assertTrue(weakref.getweakrefs(1) == [],
        r2 = weakref.ref(o)
        self.assertTrue(r1 is not r2)
        self.assertEqual(weakref.getweakrefs(o), [r2, r1])
        self.assertEqual(weakref.getweakrefcount(o), 2)
        r3 = MyRef(o)

src/p/l/plexnet-HEAD/third_party/generic/pypy/lib-python/2.5.2/test/test_weakref.py   plexnet(Download)
        ref2 = weakref.ref(o, self.callback)
        del ref1
        self.assert_(weakref.getweakrefs(o) == [ref2],
                     "list of refs does not match")
 
        o = C()
        ref1 = weakref.ref(o, self.callback)
        ref2 = weakref.ref(o, self.callback)
        del ref2
        self.assert_(weakref.getweakrefs(o) == [ref1],
 
        del ref1
        self.assert_(weakref.getweakrefs(o) == [],
                     "list of refs not cleared")
 
        # assumes ints do not support weakrefs
        self.assert_(weakref.getweakrefs(1) == [],
        r3 = MyRef(o)
        self.assertEqual(weakref.getweakrefcount(o), 3)
        refs = weakref.getweakrefs(o)
        self.assertEqual(len(refs), 3)
        self.assert_(r2 is refs[0])

src/p/l/plexnet-HEAD/third_party/generic/pypy/lib-python/modified-2.5.2/test/test_weakref.py   plexnet(Download)
        del ref1
        test_support.gc_collect()
        self.assert_(weakref.getweakrefs(o) == [ref2],
                     "list of refs does not match")
 
        del ref2
        test_support.gc_collect()
        self.assert_(weakref.getweakrefs(o) == [ref1],
                     "list of refs does not match")
 
        del ref1
        test_support.gc_collect()
        self.assert_(weakref.getweakrefs(o) == [],
 
        # assumes ints do not support weakrefs
        self.assert_(weakref.getweakrefs(1) == [],
                     "list of refs does not match for int")
 
        r3 = MyRef(o)
        self.assertEqual(weakref.getweakrefcount(o), 3)
        refs = weakref.getweakrefs(o)
        self.assertEqual(len(refs), 3)
        self.assert_(r2 is refs[0])

src/t/r/TrustRouter-HEAD/client/packaging/Windows/Python32/Lib/test/test_weakref.py   TrustRouter(Download)
        ref2 = weakref.ref(o, self.callback)
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [ref2],
                     "list of refs does not match")
 
        o = C()
        ref1 = weakref.ref(o, self.callback)
        ref2 = weakref.ref(o, self.callback)
        del ref2
        self.assertTrue(weakref.getweakrefs(o) == [ref1],
 
        del ref1
        self.assertTrue(weakref.getweakrefs(o) == [],
                     "list of refs not cleared")
 
        # assumes ints do not support weakrefs
        self.assertTrue(weakref.getweakrefs(1) == [],
        r2 = weakref.ref(o)
        self.assertTrue(r1 is not r2)
        self.assertEqual(weakref.getweakrefs(o), [r2, r1])
        self.assertEqual(weakref.getweakrefcount(o), 2)
        r3 = MyRef(o)

  1 | 2 | 3  Next