I've come across a package which consistently has functions of the form:
def function(
arg1,
arg2,
*,
arg3=None,
arg4=None,
...
argN=None
)
I'm trying to understand the purpose of forcing the keyword arguments if they have defaults. In particular, there are two scenarios:
Scenario 1: The keyword arguments are not provided. Without the defaults, this would throw an error, but with the defaults, the function has the same exact behavior it would have without the forcing.
Scenario 2: The keyword arguments are provided, again yielding the same exact behavior it would have without the forcing.
Is there something I am missing/not understanding with this approach? All of the forced arguments have defaults.
Thanks!