Stop allowing positional arguments besides q for API.search
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 04:20:25 +0000 (22:20 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 04:20:25 +0000 (22:20 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index 34e0a0c75463987ab736f2bfce8cb80e34551791..3c07cd2ccd995b279490bbb74cc310e9b4a38000 100644 (file)
@@ -1136,13 +1136,13 @@ class API:
 
     @pagination(mode='id')
     @payload('search_results')
-    def search(self, q, *args, **kwargs):
+    def search(self, q, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets
         """
         return self.request(
-            'GET', 'search/tweets', q, *args, endpoint_parameters=(
-                'q', 'lang', 'locale', 'since_id', 'geocode', 'max_id',
-                'until', 'result_type', 'count', 'include_entities'
+            'GET', 'search/tweets', q, endpoint_parameters=(
+                'q', 'geocode', 'lang', 'locale', 'result_type', 'count',
+                'until', 'since_id', 'max_id', 'include_entities'
             ), **kwargs
         )