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

Put py: Python argument at beginning or end of argument list? #33

Closed
dgrunwald opened this issue Oct 25, 2015 · 1 comment
Closed

Put py: Python argument at beginning or end of argument list? #33

dgrunwald opened this issue Oct 25, 2015 · 1 comment
Labels

Comments

@dgrunwald
Copy link
Owner

Now that #15 is adding a py: Python argument to almost every function, we should pick a consistent position for that argument.

Beginning: fn(Python, ...)
End: fn(..., Python)

Calls seem more readable to me in the beginning position:
some_method(py, nested_call(py, long, argument, list))
vs.
some_method(nested_call(long, argument, list, py), py)

If we want the non-Copy Python token, and use the beginning position, nested calls will fail to compile with Rust's current reborrowing semantics. This might or might not be fixed in a future Rust version.

However, there are good reasons for Python to remain Copy, so I think the beginning position is the correct choice.

@ehiggs
Copy link
Contributor

ehiggs commented Oct 25, 2015

Beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants