Improve parameter order in API.lookup_friendships
authorHarmon <Harmon758@gmail.com>
Fri, 12 Feb 2021 03:53:11 +0000 (21:53 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 12 Feb 2021 03:53:11 +0000 (21:53 -0600)
So as to match Twitter API documentation

tweepy/api.py

index 69bee23c4bf9ff5dfcc55be90291a425d969266d..97c0d09d7c4965b5d5596ece016e65c0d2bed6bd 100644 (file)
@@ -585,13 +585,13 @@ class API:
         )
 
     @payload('relationship', list=True)
-    def lookup_friendships(self, *, user_id=None, screen_name=None, **kwargs):
+    def lookup_friendships(self, *, screen_name=None, user_id=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup
         """
         return self.request(
-            'GET', 'friendships/lookup', list_to_csv(user_id),
-            list_to_csv(screen_name), endpoint_parameters=(
-                'user_id', 'screen_name'
+            'GET', 'friendships/lookup', list_to_csv(screen_name),
+            list_to_csv(user_id), endpoint_parameters=(
+                'screen_name', 'user_id'
             ), **kwargs
         )