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

docs/api.rst
tweepy/api.py

index 8293e2ac9e7dcf5adda29126b6782e1bb09eb4dd..e8f3aa6f9539db3c6a3929d2af26a2fb678dad14 100644 (file)
@@ -98,6 +98,8 @@ Create and manage lists
 
 .. automethod:: API.add_list_members
 
+.. automethod:: API.remove_list_member
+
 
 User methods
 ------------
@@ -619,21 +621,6 @@ List Methods
    :rtype: :class:`List` object
 
 
-.. method:: API.remove_list_member(list_id/slug, screen_name/user_id, \
-                                   [owner_id/owner_screen_name])
-
-   Removes the specified member from the list. The authenticated user must be
-   the list's owner to remove members from the list.
-
-   :param list_id: |list_id|
-   :param slug: |slug|
-   :param screen_name: |screen_name|
-   :param user_id: |user_id|
-   :param owner_id: |owner_id|
-   :param owner_screen_name: |owner_screen_name|
-   :rtype: :class:`List` object
-
-
 .. method:: API.remove_list_members(list_id/slug, screen_name/user_id, \
                                     [owner_id/owner_screen_name])
 
index de18b2d8b42048007831a9104c4634bebaba600d..18d6aab2d7c737f0b7e0b0e93950fee803aee88e 100644 (file)
@@ -1253,6 +1253,32 @@ class API:
             ), **kwargs
         )
 
+    @payload('list')
+    def remove_list_member(self, **kwargs):
+        """remove_list_member(*, list_id, slug, user_id, screen_name, \
+                              owner_screen_name, owner_id)
+
+        Removes the specified member from the list. The authenticated user must
+        be the list's owner to remove members from the list.
+
+        :param list_id: |list_id|
+        :param slug: |slug|
+        :param user_id: |user_id|
+        :param screen_name: |screen_name|
+        :param owner_screen_name: |owner_screen_name|
+        :param owner_id: |owner_id|
+
+        :rtype: :class:`List` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy
+        """
+        return self.request(
+            'POST', 'lists/members/destroy', endpoint_parameters=(
+                'list_id', 'slug', 'user_id', 'screen_name',
+                'owner_screen_name', 'owner_id'
+            ), **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
@@ -1840,17 +1866,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('list')
-    def remove_list_member(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy
-        """
-        return self.request(
-            'POST', 'lists/members/destroy', endpoint_parameters=(
-                'list_id', 'slug', 'user_id', 'screen_name',
-                'owner_screen_name', 'owner_id'
-            ), **kwargs
-        )
-
     @payload('list')
     def remove_list_members(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all