Stop allowing positional arguments for API.lists_memberships
authorHarmon <Harmon758@gmail.com>
Sun, 14 Feb 2021 06:42:19 +0000 (00:42 -0600)
committerHarmon <Harmon758@gmail.com>
Sun, 14 Feb 2021 06:42:19 +0000 (00:42 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index ea04d5c72ef69eb996e47c82b0b85e44aa16da28..fbca4fe2862ee3f273bd6dd4584f7eec92a1e987 100644 (file)
@@ -935,13 +935,13 @@ class API:
 
     @pagination(mode='cursor')
     @payload('list', list=True)
-    def lists_memberships(self, *args, **kwargs):
+    def lists_memberships(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships
         """
         return self.request(
-            'GET', 'lists/memberships', *args, endpoint_parameters=(
-                'screen_name', 'user_id', 'filter_to_owned_lists', 'cursor',
-                'count'
+            'GET', 'lists/memberships', endpoint_parameters=(
+                'user_id', 'screen_name', 'count', 'cursor',
+                'filter_to_owned_lists'
             ), **kwargs
         )