def _removeOldBackRefs(senderkey, signal, receiver, receivers):
 try:
  index = receivers.index(receiver)
 except ValueError:
  return False
 else:
  oldReceiver = receivers[index]
  del receivers[index]
  found = 0
  signals = connections.get(signal)
  if (signals is not None):
   for (sig, recs) in connections.get(signal, {}).iteritems():
    if (sig != signal):
     for rec in recs:
      if (rec is oldReceiver):
       found = 1
       break
  if (not found):
   _killBackref(oldReceiver, senderkey)
   return True
  return False

def _removeOldBackRefs ( senderkey , signal , receiver , receivers ) : try : index = receivers . index ( receiver ) except ValueError : return False else : oldReceiver = receivers [ index ] del receivers [ index ] found = 0 signals = connections . get ( signal ) if ( signals is not None ) : for ( sig , recs ) in connections . get ( signal , { } ) . iteritems ( ) : if ( sig != signal ) : for rec in recs : if ( rec is oldReceiver ) : found = 1 break if ( not found ) : _killBackref ( oldReceiver , senderkey ) return True return False
kill old sendersback references from receiver this guards against multiple registration of the same receiver for a given signal and sender leaking memory as old back reference records build up .