{"comment":{"url":"https://api.github.com/repos/coala-analyzer/coala/comments/15681776","html_url":"https://github.com/coala-analyzer/coala/commit/62e7cbf819787a972ce52d173251278cfb8c0630#commitcomment-15681776","id":15681776,"user":{"login":"Makman2","id":6023916,"avatar_url":"https://avatars.githubusercontent.com/u/6023916?v=3","gravatar_id":"","url":"https://api.github.com/users/Makman2","html_url":"https://github.com/Makman2","followers_url":"https://api.github.com/users/Makman2/followers","following_url":"https://api.github.com/users/Makman2/following{/other_user}","gists_url":"https://api.github.com/users/Makman2/gists{/gist_id}","starred_url":"https://api.github.com/users/Makman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makman2/subscriptions","organizations_url":"https://api.github.com/users/Makman2/orgs","repos_url":"https://api.github.com/users/Makman2/repos","events_url":"https://api.github.com/users/Makman2/events{/privacy}","received_events_url":"https://api.github.com/users/Makman2/received_events","type":"User","site_admin":false},"position":26,"line":83,"path":"coalib/results/SourceRange.py","commit_id":"62e7cbf819787a972ce52d173251278cfb8c0630","created_at":"2016-01-26T16:23:57Z","updated_at":"2016-01-26T16:23:57Z","body":"Could you please invoke the function from `TextRange`, so we have less code duplication?\r\n\r\n```\r\ntr = TextRange.expand(self, file_contents)\r\nreturn type(self).from_values(self.file, tr.start.line, tr.start.column, ...)\r\n```\r\nMaybe it's then worth to add inside another commit a classmethod that allows to instantiate a `SourceRange` from a `TextRange`:\r\n```python\r\n@classmethod\r\ndef from_textrange(cls, textrange, file):\r\n    pass\r\n```\r\nso you can do this:\r\n```python\r\nreturn type(self).from_textrange(TextRange.expand(self, file_contents), self.file)\r\n```\r\nand we have an easy single-liner :)"}}