I have a function, say:
def func(arg1, arg2=5):
blah blah
Unfortunately, a library that I'm using asks for an input to be instance of a class, so I cannot just pass my custom made function above.
I need a class wrapper
around it, so that I pass:
MyClass(arg2=4)
and the result is the function shown above, ready to be executed with its second argument set to 4.
How can I do that?
My attempt: lambda x: func(x, arg2=4)
However, this is not an instance of a class. I want to mimic that library where their functions are instances of classes.