@staticmethod
def append_sig_to_list_replacing_if_identical(sig_list, sig):
    """Return `sig_list` either with `sig` appended or with any identical
        signature (according only to type equality, not attributes) replaced
        if one is there.  This is called in `register_handler_funs`."""
    try:
        sig_list.remove(sig)
    except ValueError:
        pass
    sig_list.append(sig)
    return sig_list
