Skip to content

Commit

Permalink
Rename API.friends to API.get_friends
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Jun 3, 2021
1 parent fa5e7c4 commit 6f3fccb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
+------------------------------------------+--------------------------------------+
| `GET friends/ids`_ | :meth:`API.friends_ids` |
+------------------------------------------+--------------------------------------+
| `GET friends/list`_ | :meth:`API.friends` |
| `GET friends/list`_ | :meth:`API.get_friends` |
+------------------------------------------+--------------------------------------+
| `GET friendships/incoming`_ | :meth:`API.incoming_friendships` |
+------------------------------------------+--------------------------------------+
Expand Down Expand Up @@ -476,7 +476,7 @@ Follow, search, and get users

.. automethod:: API.friends_ids

.. automethod:: API.friends
.. automethod:: API.get_friends

.. automethod:: API.incoming_friendships

Expand Down
6 changes: 3 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def testfriendsids(self):
def testgetfollowerids(self):
self.api.get_follower_ids(screen_name=username)

@tape.use_cassette('testfriends.yaml', serializer='yaml')
def testfriends(self):
self.api.friends(screen_name=username)
@tape.use_cassette('testgetfriends.yaml', serializer='yaml')
def testgetfriends(self):
self.api.get_friends(screen_name=username)

@tape.use_cassette('testgetfollowers.yaml', serializer='yaml')
def testgetfollowers(self):
Expand Down
6 changes: 3 additions & 3 deletions tweepy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2132,9 +2132,9 @@ def friends_ids(self, **kwargs):

@pagination(mode='cursor')
@payload('user', list=True)
def friends(self, **kwargs):
"""friends(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
def get_friends(self, **kwargs):
"""get_friends(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
Returns a user's friends ordered in which they were added 100 at a
time. If no user is specified it defaults to the authenticated user.
Expand Down
2 changes: 1 addition & 1 deletion tweepy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def timeline(self, **kwargs):
return self._api.user_timeline(user_id=self.id, **kwargs)

def friends(self, **kwargs):
return self._api.friends(user_id=self.id, **kwargs)
return self._api.get_friends(user_id=self.id, **kwargs)

def followers(self, **kwargs):
return self._api.get_followers(user_id=self.id, **kwargs)
Expand Down

0 comments on commit 6f3fccb

Please sign in to comment.