Skip to content

Commit ac8c1b6

Browse files
committed
Update github3.search.user for consistency
1 parent ad56d5a commit ac8c1b6

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

github3/search/user.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,28 @@
66

77

88
class UserSearchResult(GitHubCore):
9-
def _update_attributes(self, data):
10-
result = data.copy()
9+
"""Representation of a search result for a user.
10+
11+
This object has the following attributes:
12+
13+
.. attribute:: score
14+
15+
The confidence score of this result.
1116
12-
#: Score of the result
13-
self.score = self._get_attribute(result, 'score')
14-
if 'score' in result:
15-
del result['score']
17+
.. attribute:: text_matches
1618
17-
#: Text matches
18-
self.text_matches = self._get_attribute(result, 'text_matches', [])
19-
if 'text_matches' in result:
20-
del result['text_matches']
19+
If present, a list of text strings that match the search string.
2120
22-
#: User object matching the search
21+
.. attribute:: user
22+
23+
A :class:`~github3.users.ShortUser` representing the user found
24+
in this search result.
25+
"""
26+
27+
def _update_attributes(self, data):
28+
result = data.copy()
29+
self.score = result.pop('score')
30+
self.text_matches = result.pop('text_matches', [])
2331
self.user = users.ShortUser(result, self)
2432

2533
def _repr(self):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy