From 0ee3935511fc915c510fd4a9dcf78f1307e7beae Mon Sep 17 00:00:00 2001 From: Christian Teijon Date: Wed, 12 May 2021 21:14:00 +0200 Subject: [PATCH] Remove async from filter and sample functions 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/asynchronous/streaming.py b/tweepy/asynchronous/streaming.py index 0aee94e..65df003 100644 --- a/tweepy/asynchronous/streaming.py +++ b/tweepy/asynchronous/streaming.py @@ -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 -- 2.25.1