def test_cp14632():
 def helper_func():
  class C:
   def __eq__(self, *args, **kwargs):
    return True
  a = C()
  Assert((C() == 3))
  x = _weakref.proxy(a)
  y = _weakref.proxy(a)
  AreEqual(x, y)
  keep_alive(a)
  return (x, y)
 (x, y) = helper_func()
 gc.collect()
 Assert((not (x == 3)))
 AssertError(ReferenceError, (lambda : (x == y)))

def test_cp14632 ( ) : def helper_func ( ) : class C : def __eq__ ( self , * args , ** kwargs ) : return True a = C ( ) Assert ( ( C ( ) == 3 ) ) x = _weakref . proxy ( a ) y = _weakref . proxy ( a ) AreEqual ( x , y ) keep_alive ( a ) return ( x , y ) ( x , y ) = helper_func ( ) gc . collect ( ) Assert ( ( not ( x == 3 ) ) ) AssertError ( ReferenceError , ( lambda : ( x == y ) ) )
make sure _weakref .