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

docs/api.rst
tweepy/api.py

index 01e218195f16ac2c4ac41e31d66acce248f03bce..9cf91d927de8a5e9c9ea78623775e95b490fbe1f 100644 (file)
@@ -80,6 +80,8 @@ Create and manage lists
 
 .. automethod:: API.lists_ownerships
 
+.. automethod:: API.get_list
+
 
 User methods
 ------------
@@ -660,18 +662,6 @@ List Methods
    :rtype: list of :class:`Status` objects
 
 
-.. method:: API.get_list(list_id/slug, [owner_id/owner_screen_name])
-
-   Returns the specified list. Private lists 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|
-   :rtype: :class:`List` object
-
-
 .. method:: API.add_list_member(list_id/slug, screen_name/user_id, \
                                 [owner_id/owner_screen_name])
 
index 6620c5cab808fa56984ea7fbcb3ea83610faf5cc..970bb95e057bc149b9831ce561f156bfa2389eff 100644 (file)
@@ -1014,6 +1014,28 @@ class API:
             ), **kwargs
         )
 
+    @payload('list')
+    def get_list(self, **kwargs):
+        """get_list(*, list_id, slug, owner_screen_name, owner_id)
+
+        Returns the specified list. Private lists 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|
+
+        :rtype: :class:`List` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show
+        """
+        return self.request(
+            'GET', 'lists/show', endpoint_parameters=(
+                'list_id', 'slug', '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
@@ -1644,16 +1666,6 @@ class API:
             ), **kwargs
         )
 
-    @payload('list')
-    def get_list(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show
-        """
-        return self.request(
-            'GET', 'lists/show', endpoint_parameters=(
-                'list_id', 'slug', 'owner_screen_name', 'owner_id'
-            ), **kwargs
-        )
-
     @payload('list')
     def add_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-create