def METHOD_NAME(self, selectable, mdict):
    try:
        # the easy way
        fd = selectable.fileno()
        # make sure the fd is actually real.  In some situations we can get
        # -1 here.
        mdict[fd]
    except BaseException:
        # the hard way: necessary because fileno() may disappear at any
        # moment, thanks to python's underlying sockets impl
        for fd, fdes in self._selectables.items():
            if selectable is fdes:
                break
        else:
            # Hmm, maybe not the right course of action?  This method can't
            # fail, because it happens inside error detection...
            return
    if fd in mdict:
        del mdict[fd]
        self._updateRegistration(fd)