def disconnect(receiver, signal=Any, sender=Any, weak=True):
    """Disconnect receiver from sender for signal

    receiver -- the registered receiver to disconnect
    signal -- the registered signal to disconnect
    sender -- the registered sender to disconnect
    weak -- the weakref state to disconnect

    disconnect reverses the process of connect,
    the semantics for the individual elements are
    logically equivalent to a tuple of
    (receiver, signal, sender, weak) used as a key
    to be deleted from the internal routing tables.
    (The actual process is slightly more complex
    but the semantics are basically the same).

    Note:
        Using disconnect is not required to cleanup
        routing when an object is deleted, the framework
        will remove routes for deleted objects
        automatically.  It's only necessary to disconnect
        if you want to stop routing to a live object.
        
    returns None, may raise DispatcherTypeError or
        DispatcherKeyError
    """
    if signal is None:
        raise errors.DispatcherTypeError(
            'Signal cannot be None (receiver=%r sender=%r)'%( receiver,sender)
        )
    if weak: receiver = saferef.safeRef(receiver)
    senderkey = id(sender)
    try:
        signals = connections[senderkey]
        receivers = signals[signal]
    except KeyError:
        raise errors.DispatcherKeyError(
            """No receivers found for signal %r from sender %r""" %(
                signal,
                sender
            )
        )
    try:
        # also removes from receivers
        _removeOldBackRefs(senderkey, signal, receiver, receivers)
    except ValueError:
        raise errors.DispatcherKeyError(
            """No connection to receiver %s for signal %s from sender %s""" %(
                receiver,
                signal,
                sender
            )
        )
    _cleanupConnections(senderkey, signal)
Disconnect receiver from sender for signal

    receiver -- the registered receiver to disconnect
    signal -- the registered signal to disconnect
    sender -- the registered sender to disconnect
    weak -- the weakref state to disconnect

    disconnect reverses the process of connect,
    the semantics for the individual elements are
    logically equivalent to a tuple of
    (receiver, signal, sender, weak) used as a key
    to be deleted from the internal routing tables.
    (The actual process is slightly more complex
    but the semantics are basically the same).

    Note:
        Using disconnect is not required to cleanup
        routing when an object is deleted, the framework
        will remove routes for deleted objects
        automatically.  It's only necessary to disconnect
        if you want to stop routing to a live object.
        
    returns None, may raise DispatcherTypeError or
        DispatcherKeyError