Lines Matching refs:ref1
135 ref1 = weakref.ref(o, self.callback)
138 self.assertIsNone(ref1(), "expected reference to be invalidated")
158 ref1 = weakref.ref(c, callback)
168 ref1 = weakref.proxy(o, self.callback)
175 self.assertRaises(ReferenceError, check, ref1)
201 ref1 = weakref.ref(o)
206 self.assertIs(ref1, ref2,
211 ref1 = weakref.ref(o)
213 self.assertIs(ref1, ref2,
322 ref1 = weakref.proxy(o)
324 self.check_proxy(o, ref1)
326 self.assertIs(type(ref1), weakref.CallableProxyType,
328 ref1('twinkies!')
331 ref1(x='Splat.')
336 self.assertRaises(TypeError, ref1)
339 self.assertRaises(TypeError, ref1, 1, 2, 3)
381 ref1 = weakref.ref(o)
391 del ref1, ref2, proxy1, proxy2
402 ref1 = weakref.ref(o, self.callback)
404 del ref1
409 ref1 = weakref.ref(o, self.callback)
412 self.assertEqual(weakref.getweakrefs(o), [ref1],
415 del ref1
852 ref1 = weakref.ref(x, callback)
853 self.assertIs(ref1.__callback__, callback)
869 ref1 = weakref.ref(x, callback)
871 ref1.__callback__ = lambda ref: None
877 ref1 = weakref.ref(x, lambda ref: support.gc_collect())