From ce768d974ae7c4b907aeff580728b1045c2d85d2 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 3 Jun 2021 07:00:17 -0500 Subject: [PATCH] Rename API.followers to API.get_followers --- cassettes/{testfollowers.yaml => testgetfollowers.yaml} | 0 docs/api.rst | 4 ++-- docs/pagination.rst | 2 +- tests/test_api.py | 6 +++--- tweepy/api.py | 6 +++--- tweepy/models.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename cassettes/{testfollowers.yaml => testgetfollowers.yaml} (100%) diff --git a/cassettes/testfollowers.yaml b/cassettes/testgetfollowers.yaml similarity index 100% rename from cassettes/testfollowers.yaml rename to cassettes/testgetfollowers.yaml diff --git a/docs/api.rst b/docs/api.rst index 15157fe..7bb1971 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -112,7 +112,7 @@ +------------------------------------------+--------------------------------------+ | `GET followers/ids`_ | :meth:`API.followers_ids` | +------------------------------------------+--------------------------------------+ - | `GET followers/list`_ | :meth:`API.followers` | + | `GET followers/list`_ | :meth:`API.get_followers` | +------------------------------------------+--------------------------------------+ | `GET friends/ids`_ | :meth:`API.friends_ids` | +------------------------------------------+--------------------------------------+ @@ -472,7 +472,7 @@ Follow, search, and get users .. automethod:: API.followers_ids -.. automethod:: API.followers +.. automethod:: API.get_followers .. automethod:: API.friends_ids diff --git a/docs/pagination.rst b/docs/pagination.rst index f752ace..936f974 100644 --- a/docs/pagination.rst +++ b/docs/pagination.rst @@ -26,7 +26,7 @@ Example count=100).items(250): print(status.id) - for page in tweepy.Cursor(api.followers, screen_name="TwitterDev", + for page in tweepy.Cursor(api.get_followers, screen_name="TwitterDev", count=200).pages(5): print(len(page)) diff --git a/tests/test_api.py b/tests/test_api.py index 1662010..5965759 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -174,9 +174,9 @@ class TweepyAPITests(TweepyTestCase): def testfriends(self): self.api.friends(screen_name=username) - @tape.use_cassette('testfollowers.yaml', serializer='yaml') - def testfollowers(self): - self.api.followers(screen_name=username) + @tape.use_cassette('testgetfollowers.yaml', serializer='yaml') + def testgetfollowers(self): + self.api.get_followers(screen_name=username) @tape.use_cassette('testverifycredentials.json') def testverifycredentials(self): diff --git a/tweepy/api.py b/tweepy/api.py index cfcd379..576bb6e 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2056,9 +2056,9 @@ class API: @pagination(mode='cursor') @payload('user', list=True) - def followers(self, **kwargs): - """followers(*, user_id, screen_name, cursor, count, skip_status, \ - include_user_entities) + def get_followers(self, **kwargs): + """get_followers(*, user_id, screen_name, cursor, count, skip_status, \ + include_user_entities) Returns a user's followers ordered in which they were added. If no user is specified by id/screen name, it defaults to the authenticated user. diff --git a/tweepy/models.py b/tweepy/models.py index 3c1fd10..cbff9ba 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -415,7 +415,7 @@ class User(Model, HashableID): return self._api.friends(user_id=self.id, **kwargs) def followers(self, **kwargs): - return self._api.followers(user_id=self.id, **kwargs) + return self._api.get_followers(user_id=self.id, **kwargs) def follow(self): self._api.create_friendship(user_id=self.id) -- 2.25.1