I would like to be able to wrap a function, while still allowing optional (keyword) arguments in the outer function. I can do this:
def outer(p1, p2, *a, **k):
inner(*a, **k)
but what if I want for p2 to be an "optional argument"? Obviously:
def outer(p1, p2=None, *a, **k):
inner(*a, **k)
won't work, and I know why it won't work. I'm wondering if there's a nice, clean way to achieve this. Is there some well-known pattern or convention?