Update and improve documentation for API.show_list_member
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:01:34 +0000 (10:01 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:01:34 +0000 (10:01 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add include_entities and skip_status parameters to documentation
Improve parameter order in documentation

docs/api.rst
tweepy/api.py

index 6972d715ceb8b867bd3d1e9d9ad442b85b98b6d9..bae5466a7724cf316452c7e154e0a9a84e4b6437 100644 (file)
@@ -74,6 +74,8 @@ Create and manage lists
 
 .. automethod:: API.list_members
 
+.. automethod:: API.show_list_member
+
 
 User methods
 ------------
@@ -762,20 +764,6 @@ List Methods
    :rtype: :class:`List` object
 
 
-.. method:: API.show_list_member(list_id/slug, screen_name/user_id, \
-                                 [owner_id/owner_screen_name])
-
-   Check if the specified user is a member of the specified 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:`User` object if user is a member of list
-
-
 .. method:: API.subscribe_list(list_id/slug, [owner_id/owner_screen_name])
 
    Subscribes the authenticated user to the specified list.
index 34021d8f8bd0b28e3d0a85bfc8b2c4d32cfe4ba2..29bd193c6a756c276691d27860e03aa5f0732932 100644 (file)
@@ -931,6 +931,35 @@ class API:
             ), **kwargs
         )
 
+    @payload('user')
+    def show_list_member(self, **kwargs):
+        """show_list_member(*, list_id, slug, user_id, screen_name, \
+                            owner_screen_name, owner_id, include_entities, \
+                            skip_status)
+
+        Check if the specified user is a member of the specified 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|
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+
+        :rtype: :class:`User` object if user is a member of list
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show
+        """
+        return self.request(
+            'GET', 'lists/members/show', endpoint_parameters=(
+                'list_id', 'slug', 'user_id', 'screen_name',
+                'owner_screen_name', 'owner_id', '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
@@ -1646,18 +1675,6 @@ class API:
             ), **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
-        """
-        return self.request(
-            'GET', 'lists/members/show', endpoint_parameters=(
-                'list_id', 'slug', 'user_id', 'screen_name',
-                'owner_screen_name', 'owner_id', 'include_entities',
-                'skip_status'
-            ), **kwargs
-        )
-
     @payload('list')
     def subscribe_list(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create