From: Harmon Date: Tue, 2 Feb 2021 17:41:14 +0000 (-0600) Subject: Move APIMethod.build_parameters call from APIMethod.__init__ to bind_api X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=971891cc23e6f1c78cb362de906a1cc11e8958c3;p=tweepy.git Move APIMethod.build_parameters call from APIMethod.__init__ to bind_api --- diff --git a/tweepy/binder.py b/tweepy/binder.py index 406272e..8a3cebb 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -17,12 +17,9 @@ log = logging.getLogger(__name__) class APIMethod: - def __init__(self, *args, **kwargs): + def __init__(self): self.session = requests.Session() - allowed_param = kwargs.pop('allowed_param', []) - self.build_parameters(allowed_param, args, kwargs) - # Monitoring rate limits self._remaining_calls = None self._reset_time = None @@ -194,7 +191,9 @@ def bind_api(*args, **kwargs): upload_api = kwargs.pop('upload_api', False) use_cache = kwargs.pop('use_cache', True) - method = APIMethod(*args, **kwargs) + method = APIMethod() + allowed_param = kwargs.pop('allowed_param', []) + method.build_parameters(allowed_param, args, kwargs) try: if kwargs.get('create'): return method