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

Why update method both modifies data and returns it? #10

Closed
petar-donchev opened this issue Nov 30, 2017 · 1 comment
Closed

Why update method both modifies data and returns it? #10

petar-donchev opened this issue Nov 30, 2017 · 1 comment

Comments

@petar-donchev
Copy link

petar-donchev commented Nov 30, 2017

Wouldn't it be better if there are two methods in public API, one that modifies its argument and returns nothing, and one that does not modify it and returns a modified copy? Or just have one of these.

@michaelmior
Copy link
Collaborator

Having the method work like this means you can do some easier chaining in some cases. Both of the use cases you present are still possible. However, if you have a concrete proposal for improving the API, feel free to submit a pull request.

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

No branches or pull requests

2 participants