Update and improve documentation for API.list_subscribers
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:24:06 +0000 (10:24 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:24:06 +0000 (10:24 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Improve parameter order in documentation

docs/api.rst
tweepy/api.py

index b2b75ab6630089a50971f25a4436703cc0f74ff5..d294e8d3f1f89492f5e1631a151c43bea77f67c4 100644 (file)
@@ -84,6 +84,8 @@ Create and manage lists
 
 .. automethod:: API.list_timeline
 
+.. automethod:: API.list_subscribers
+
 
 User methods
 ------------
@@ -728,24 +730,6 @@ List Methods
    :rtype: :class:`List` object
 
 
-.. method:: API.list_subscribers(list_id/slug, [owner_id/owner_screen_name], \
-                                 [cursor], [count], [include_entities], \
-                                 [skip_status])
-
-   Returns the subscribers of the specified list. Private list subscribers will
-   only be shown if the authenticated user owns the specified list.
-
-   :param list_id: |list_id|
-   :param slug: |slug|
-   :param owner_id: |owner_id|
-   :param owner_screen_name: |owner_screen_name|
-   :param cursor: |cursor|
-   :param count: |count|
-   :param include_entities: |include_entities|
-   :param skip_status: |skip_status|
-   :rtype: list of :class:`User` objects
-
-
 .. method:: API.show_list_subscriber(list_id/slug, screen_name/user_id, \
                                      [owner_id/owner_screen_name])
 
index 0733ac996f55d6fb85acd80029970b6538018ccb..d25f9b96fa23d521077ec9ad52330074d0b33ee0 100644 (file)
@@ -1071,6 +1071,35 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('user', list=True)
+    def list_subscribers(self, **kwargs):
+        """list_subscribers(*, list_id, slug, owner_screen_name, owner_id, \
+                            count, cursor, include_entities, skip_status)
+
+        Returns the subscribers of the specified list. Private list subscribers
+        will only be shown if the authenticated user owns the specified list.
+
+        :param list_id: |list_id|
+        :param slug: |slug|
+        :param owner_screen_name: |owner_screen_name|
+        :param owner_id: |owner_id|
+        :param count: |count|
+        :param cursor: |cursor|
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+
+        :rtype: list of :class:`User` objects
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers
+        """
+        return self.request(
+            'GET', 'lists/subscribers', endpoint_parameters=(
+                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'count',
+                'cursor', 'include_entities', 'skip_status'
+            ), **kwargs
+        )
+
     def media_upload(self, filename, *, file=None, chunked=False,
                      media_category=None, additional_owners=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview
@@ -1761,18 +1790,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('user', list=True)
-    def list_subscribers(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers
-        """
-        return self.request(
-            'GET', 'lists/subscribers', endpoint_parameters=(
-                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'count',
-                'cursor', 'include_entities', 'skip_status'
-            ), **kwargs
-        )
-
     @payload('user')
     def show_list_subscriber(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show