def newConstantFunction(val):
    """Returns a function which accepts any kind of parameter, does nothing and returns the value val."""
    def constantFunction(*args, **kwargs):
        _ = args, kwargs
        return val
    return constantFunction