-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow reverse pagination #184
Allow reverse pagination #184
Conversation
This uses the 'last' and 'prev' links in the HTTP headers. The usage is repo.get_issues().reversed
sorry for the broken build. fixing now. |
Fixes a bug introduced in the previous commits. Now testing a case where no lastUrl is returned. Also fixing a regression where nextUrl wasn't erased properly.
Changed reversed(content) to content[::-1] in order to return a real list and not a generator. The code in PaginatedListBase.__grow does an iteration over newElements when using `+=` and then returns them. When using a generator, newElements would be empty when they are returned.
nice, that could be useful! |
I didn't add any documentation. |
This sounds interesting, thank you! I'm back from holidays, I will analyze this PR in details soon. |
This will avoid surprises if both the list and its reversed version are iterated.
cool 👍 |
Introduced a feature to
PaginatedList
to allow iteration in reversed order.As a follow up do the discussion in #180