'Return the key for looking up the implementation for the given
signature on the target context.'

def get_impl_key(self, sig):

    key = type(self).key
    if isinstance(key, MethodType):
        assert (key.im_self is None)
        key = key.im_func
    return key
