Update and improve documentation for API.list_members
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 14:57:21 +0000 (09:57 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 14:57:21 +0000 (09:57 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add count, include_entities, and skip_status parameters to documentation
Improve parameter order in documentation

docs/api.rst
tweepy/api.py

index 46d73dc20dc3c7a007543b2b34a49c9f4a4b693c..6972d715ceb8b867bd3d1e9d9ad442b85b98b6d9 100644 (file)
@@ -72,6 +72,8 @@ Create and manage lists
 
 .. automethod:: API.lists_all
 
+.. automethod:: API.list_members
+
 
 User methods
 ------------
@@ -760,19 +762,6 @@ List Methods
    :rtype: :class:`List` object
 
 
-.. method:: API.list_members(list_id/slug, [owner_id/owner_screen_name], \
-                             [cursor])
-
-   Returns the members of 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|
-   :rtype: list of :class:`User` objects
-
-
 .. method:: API.show_list_member(list_id/slug, screen_name/user_id, \
                                  [owner_id/owner_screen_name])
 
index 4496ed9668150626601c3360ecb27a6278e556d6..34021d8f8bd0b28e3d0a85bfc8b2c4d32cfe4ba2 100644 (file)
@@ -903,6 +903,34 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('user', list=True)
+    def list_members(self, **kwargs):
+        """list_members(*, list_id, slug, owner_screen_name, owner_id, count, \
+                        cursor, include_entities, skip_status)
+
+        Returns the members of 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-members
+        """
+        return self.request(
+            'GET', 'lists/members', 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
@@ -1618,18 +1646,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('user', list=True)
-    def list_members(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members
-        """
-        return self.request(
-            'GET', 'lists/members', endpoint_parameters=(
-                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'count',
-                'cursor', 'include_entities', 'skip_status'
-            ), **kwargs
-        )
-
     @payload('user')
     def show_list_member(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show