Skip to content

Commit 97c262c

Browse files
committed
Update doc-strings and replace use of None for Comparisons
1 parent 4dcfee6 commit 97c262c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

github3/repos/comparison.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,21 @@ def _repr(self):
6464
return '<Comparison of {0} commits>'.format(self.total_commits)
6565

6666
def diff(self):
67-
"""Return the diff"""
67+
"""Retrieve the diff for this comparison.
68+
69+
:returns: the diff as a bytes object
70+
:rtype: bytes
71+
"""
6872
resp = self._get(self._api,
6973
headers={'Accept': 'application/vnd.github.diff'})
70-
return resp.content if self._boolean(resp, 200, 404) else None
74+
return resp.content if self._boolean(resp, 200, 404) else b''
7175

7276
def patch(self):
73-
"""Return the patch"""
77+
"""Retrieve the patch formatted diff for this commit.
78+
79+
:returns: the patch as a bytes object
80+
:rtype: bytes
81+
"""
7482
resp = self._get(self._api,
7583
headers={'Accept': 'application/vnd.github.patch'})
76-
return resp.content if self._boolean(resp, 200, 404) else None
84+
return resp.content if self._boolean(resp, 200, 404) else b''

0 commit comments

Comments
 (0)