I have a problem with situations where I have a lot of Keyword-Only arguments and I need to pass them to another function which gets them all as keyword-only arguments too.
Supouse I have the next code:
class A: def __init__(self, *, arg1, arg2, arg3, arg4, arg5, arg6): pass def create_instance(*, arg1, arg2, arg3, arg4, arg5, arg6): # I want to prevent to do the following sentence A(arg1=arg1, arg2=arg2, arg3=arg3, arg4=arg4, arg5=arg5, arg6=arg6) There is any trick to pass all keyword-only arguments from a function to another?. I mean something like
def create_instance(*, arg1, arg2, arg3, arg4, arg5, arg6): A(*) # dummy code that pretends to pass all keyword-only args
create_instance(**kwargs)since they are keyword only, no?