def set_val_if_dict( dct, key, val ):
    """ Set the { ... `key`:`val` ... } only if `dct` is a dictionary """
    try:
        dct[ key ] = val
        return True
    except (TypeError, KeyError):
        return False