import inspect


def get_required_kw_args(fn):
    """
    获取函数命名关键参数,且非默认参数

    :param fn: function
    :return:
    """
    args = []
    # 获取函数fn的参数, orderd mapping
    params = inspect.signature(fn).parameters
    for name, param in params.items():
        # *或者 *args 后面的参数, 且没有默认值
        if param.kind == param.KEYWORD_ONLY and param.default is param.empty:
            args.append(name)
    return tuple(args)