Remove async from filter and sample functions
authorChristian Teijon <christian13@gmail.com>
Wed, 12 May 2021 19:14:00 +0000 (21:14 +0200)
committerChristian Teijon <christian13@gmail.com>
Wed, 12 May 2021 19:14:00 +0000 (21:14 +0200)
Since these functions just return a task, they
don't need to be async.
If the async is left, it forces us to use
an unnecessary and confussing extra await when
calling them, and then another one on the task
they return.

tweepy/asynchronous/streaming.py

index 0aee94ec6670c566a5bd40dda57060a49855eb0c..65df003e98946fff352823d27df199d9d027803c 100644 (file)
@@ -144,7 +144,7 @@ class AsyncStream:
             await self.session.close()
             await self.on_disconnect()
 
-    async def filter(self, *, follow=None, track=None, locations=None,
+    def filter(self, *, follow=None, track=None, locations=None,
                      filter_level=None, languages=None, stall_warnings=False):
         """|coroutine|
 
@@ -234,7 +234,7 @@ class AsyncStream:
         )
         return self.task
 
-    async def sample(self, *, languages=None, stall_warnings=False):
+    def sample(self, *, languages=None, stall_warnings=False):
         """|coroutine|
 
         Sample realtime Tweets