Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force some arguments to be only positional and some arguments to be passed only by keyword. #495

Open
gabrieldemarmiesse opened this issue Nov 11, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gabrieldemarmiesse
Copy link
Owner

See https://docs.python.org/3/tutorial/controlflow.html#special-parameters

Why doing this? I see two reasons.

  1. Disally weird pattern that hinder code readability. Do we really want to see docker.container.inspect(x="some_name") or docker.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).

  2. Backward compatibility. If someone writes docker.container.inspect(x="some_name") then we can never change the name of the variable x without breaking compatibility. Same as if someone writes docker.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.

@gabrieldemarmiesse gabrieldemarmiesse added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant