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

Keyword arguments should be keyword only arguments in the Ray API #7548

Open
robertnishihara opened this issue Mar 11, 2020 · 2 comments
Open
Labels
P3 Issue moderate in impact or severity

Comments

@robertnishihara
Copy link
Collaborator

For example, I would suggest changing

def wait(object_ids, num_returns=1, timeout=None):

to

def wait(object_ids, *, num_returns=1, timeout=None):

This prevents users from calling ray.wait(object_ids, 1) and prevents things from breaking if we reorder keyword arguments later or add new keyword arguments.

For ray.init(), I think all arguments should be keyword only. Same with the rest of the API.

Any reason not to do this? Other than breaking existing cases that don't specify the keyword?

@simon-mo
Copy link
Contributor

I'm not against it. However, this break existing user code and we should only do in next major or minor release. That will be 0.9.0 or even 1.0

To see existing usage:
https://github.com/search?l=Python&q=%22ray.wait%22&type=Code

@ericl
Copy link
Contributor

ericl commented Mar 11, 2020

IMO this is a minor issue, not worth breaking users for. There should be a very high bar for any breaking change on a commonly used API.

@ericl ericl added the P3 Issue moderate in impact or severity label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Issue moderate in impact or severity
Projects
None yet
Development

No branches or pull requests

3 participants