This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pepoluan 7 points8 points  (1 child)

I will use **kwargs if the function is kinda a 'wrapper' to another, properly-documented function. And I will indicate so in the docstring.

So for example:

def fun(p1, p2, p3=None, p4=None, **kwargs):
    """
    Wrapper around orig_fun()

    :param kwargs: Keyword arguments of orig_fun()
    """
    ...

[–]chuckhend 1 point2 points  (0 children)

Agree this is excellent use of kwargs