Stop allowing positional arguments for API.list_members
authorHarmon <Harmon758@gmail.com>
Mon, 15 Feb 2021 07:46:30 +0000 (01:46 -0600)
committerHarmon <Harmon758@gmail.com>
Mon, 15 Feb 2021 07:46:30 +0000 (01:46 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index bb5a179401d2b6fd5dbe3c4cbb1809923c6de0a0..8d303b27a2c13047106d6970ea898d091f162ca2 100644 (file)
@@ -1043,12 +1043,12 @@ class API:
 
     @pagination(mode='cursor')
     @payload('user', list=True)
-    def list_members(self, *args, **kwargs):
+    def list_members(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-members
         """
         return self.request(
-            'GET', 'lists/members', *args, endpoint_parameters=(
-                'owner_screen_name', 'slug', 'list_id', 'owner_id', 'count',
+            'GET', 'lists/members', endpoint_parameters=(
+                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'count',
                 'cursor', 'include_entities', 'skip_status'
             ), **kwargs
         )