Force some arguments to be only positional and some arguments to be passed only by keyword. #495
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
See https://docs.python.org/3/tutorial/controlflow.html#special-parameters
Why doing this? I see two reasons.
Disally weird pattern that hinder code readability. Do we really want to see
docker.container.inspect(x="some_name")
ordocker.compose.down(True, False, True, True)
? The answer is no. We should not allow this to ensure the code shared on the internet is readable and useful for newcomers. We're responsible for the code style (same as python is responsible for PEP8).Backward compatibility. If someone writes
docker.container.inspect(x="some_name")
then we can never change the name of the variablex
without breaking compatibility. Same as if someone writesdocker.compose.down(True, False, True, True)
, we can never change the order of the arguments without breaking compatibility.Hence I would like that someone motivated (it might be me at some point if nobody wants to do it), go through the API and for each argument decide if we should allow the argument to be passed by position or by keyword. And place the correct symbols
*
and/
accordingly.Don't worry about making mistakes, we can discuss this in pull requests.
The text was updated successfully, but these errors were encountered: