From: Christian Teijon Date: Wed, 12 May 2021 19:14:00 +0000 (+0200) Subject: Remove async from filter and sample functions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0ee3935511fc915c510fd4a9dcf78f1307e7beae;p=tweepy.git 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. --- 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