id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 464717028,MDU6SXNzdWU0NjQ3MTcwMjg=,3081,Method chaining on magic methods?,4441865,closed,0,,,2,2019-07-05T17:02:44Z,2019-07-09T19:28:11Z,2019-07-09T19:28:11Z,CONTRIBUTOR,,,,"Apologies if this has been discussed, I couldn't find it. In pandas and xarray I prefer a method-chaining style, and with pandas this is now very well supported. However, xarray is missing a number of simple methods. I often find myself having to use magic methods like `__eq__` directly to avoid breaking the chain. Is there any reason not to do class DataArray: ... eq = __eq__ gt = __gt__ ge = __ge__ lt = __lt__ le = __le__ add = __add__ subtract = __sub__ multiply = __mul__ divide = __div__ pow = __pow__ # etc. Probably it is more complicated than this, but hopefully it communicates the idea. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3081/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 209523348,MDU6SXNzdWUyMDk1MjMzNDg=,1281,update_attrs method,4441865,closed,0,,,6,2017-02-22T17:23:51Z,2017-03-07T19:35:03Z,2017-03-07T19:35:03Z,CONTRIBUTOR,,,,"Updating attrs is an operation that consistently breaks up my method chaining. This should be easy to solve with something like ```` def update_attrs(self, *args, **kwargs): self.attrs.update(*args, **kwargs) return self ```` Thoughts? edit: I guess it should return a modified object rather than acting as an in-place operation...is copying appropriate here? How is this usually handled?","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1281/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue