From 1b3335da98a00b1c9e40ba42545104f54cf50c2f Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 4 Sep 2019 01:23:12 -0500 Subject: [PATCH] Add reverse as allowed parameter for API.lists_all --- docs/api.rst | 9 +++++++-- tweepy/api.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index fd77548..0e209e0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -811,7 +811,7 @@ List Methods :rtype: :class:`List` object -.. method:: API.lists_all([screen_name], [user_id]) +.. method:: API.lists_all([screen_name], [user_id], [reverse]) Returns all lists the authenticating or specified user subscribes to, including their own. The user is specified using the ``user_id`` or @@ -821,10 +821,15 @@ List Methods A maximum of 100 results will be returned by this call. Subscribed lists are returned first, followed by owned lists. This means that if a user subscribes to 90 lists and owns 20 lists, this method returns 90 - subscriptions and 10 owned lists. + subscriptions and 10 owned lists. The ``reverse`` method returns owned lists + first, so with ``reverse=true``, 20 owned lists and 80 subscriptions would + be returned. :param screen_name: |screen_name| :param user_id: |user_id| + :param reverse: A boolean indicating if you would like owned lists to be + returned first. See description above for information on how + this parameter works. :rtype: list of :class:`List` objects diff --git a/tweepy/api.py b/tweepy/api.py index 116523f..46ee22b 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1000,13 +1000,13 @@ class API(object): @property def lists_all(self): """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-list - :allowed_param: 'screen_name', 'user_id' + :allowed_param: 'screen_name', 'user_id', 'reverse' """ return bind_api( api=self, path='/lists/list.json', payload_type='list', payload_list=True, - allowed_param=['screen_name', 'user_id'], + allowed_param=['screen_name', 'user_id', 'reverse'], require_auth=True ) -- 2.25.1