{"action":"created","issue":{"url":"https://api.github.com/repos/mwclient/mwclient/issues/87","repository_url":"https://api.github.com/repos/mwclient/mwclient","labels_url":"https://api.github.com/repos/mwclient/mwclient/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/mwclient/mwclient/issues/87/comments","events_url":"https://api.github.com/repos/mwclient/mwclient/issues/87/events","html_url":"https://github.com/mwclient/mwclient/issues/87","id":91350801,"number":87,"title":"Add 'end' argument for various lists/generators","user":{"login":"AdamWill","id":916551,"avatar_url":"https://avatars.githubusercontent.com/u/916551?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamWill","html_url":"https://github.com/AdamWill","followers_url":"https://api.github.com/users/AdamWill/followers","following_url":"https://api.github.com/users/AdamWill/following{/other_user}","gists_url":"https://api.github.com/users/AdamWill/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamWill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamWill/subscriptions","organizations_url":"https://api.github.com/users/AdamWill/orgs","repos_url":"https://api.github.com/users/AdamWill/repos","events_url":"https://api.github.com/users/AdamWill/events{/privacy}","received_events_url":"https://api.github.com/users/AdamWill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mwclient/mwclient/milestones/5","html_url":"https://github.com/mwclient/mwclient/milestones/v0.8.2","labels_url":"https://api.github.com/repos/mwclient/mwclient/milestones/5/labels","id":1567268,"number":5,"title":"v0.8.2","description":"","creator":{"login":"danmichaelo","id":434495,"avatar_url":"https://avatars.githubusercontent.com/u/434495?v=3","gravatar_id":"","url":"https://api.github.com/users/danmichaelo","html_url":"https://github.com/danmichaelo","followers_url":"https://api.github.com/users/danmichaelo/followers","following_url":"https://api.github.com/users/danmichaelo/following{/other_user}","gists_url":"https://api.github.com/users/danmichaelo/gists{/gist_id}","starred_url":"https://api.github.com/users/danmichaelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmichaelo/subscriptions","organizations_url":"https://api.github.com/users/danmichaelo/orgs","repos_url":"https://api.github.com/users/danmichaelo/repos","events_url":"https://api.github.com/users/danmichaelo/events{/privacy}","received_events_url":"https://api.github.com/users/danmichaelo/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2016-02-05T21:55:55Z","updated_at":"2016-02-05T21:56:05Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-06-26T20:10:09Z","updated_at":"2016-04-20T22:30:24Z","closed_at":null,"body":"Quite a lot of lists and generators have a `start` argument letting you specify where the results should start, but none of them seem to have the obvious corresponding `end` argument letting you specify where the results should stop. The API generators do offer this - whenever the `allpages` generator is being used, for instance, you can specify `gapto` (as you specify `gapfrom` for the `start` argument). For instance, to handle it in `PageList` the diff would just be:\r\n\r\n    diff --git a/mwclient/listing.py b/mwclient/listing.py\r\n    index 0e68e94..611221c 100644\r\n    --- a/mwclient/listing.py\r\n    +++ b/mwclient/listing.py\r\n    @@ -161,7 +161,7 @@ class Category(page.Page, GeneratorList):\r\n     \r\n     class PageList(GeneratorList):\r\n     \r\n    -    def __init__(self, site, prefix=None, start=None, namespace=0, redirects='all'):\r\n    +    def __init__(self, site, prefix=None, start=None, end=None, namespace=0, redirects='all'):\r\n             self.namespace = namespace\r\n     \r\n             kwargs = {}\r\n    @@ -169,6 +169,8 @@ class PageList(GeneratorList):\r\n                 kwargs['gapprefix'] = prefix\r\n             if start:\r\n                 kwargs['gapfrom'] = start\r\n    +        if end:\r\n    +            kwargs['gapto'] = end\r\n     \r\n             GeneratorList.__init__(self, site, 'allpages', 'ap',\r\n                                    gapnamespace=text_type(namespace), gapfilterredir=redirects, **kwargs)\r\n"},"comment":{"url":"https://api.github.com/repos/mwclient/mwclient/issues/comments/212638757","html_url":"https://github.com/mwclient/mwclient/issues/87#issuecomment-212638757","issue_url":"https://api.github.com/repos/mwclient/mwclient/issues/87","id":212638757,"user":{"login":"AdamWill","id":916551,"avatar_url":"https://avatars.githubusercontent.com/u/916551?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamWill","html_url":"https://github.com/AdamWill","followers_url":"https://api.github.com/users/AdamWill/followers","following_url":"https://api.github.com/users/AdamWill/following{/other_user}","gists_url":"https://api.github.com/users/AdamWill/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamWill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamWill/subscriptions","organizations_url":"https://api.github.com/users/AdamWill/orgs","repos_url":"https://api.github.com/users/AdamWill/repos","events_url":"https://api.github.com/users/AdamWill/events{/privacy}","received_events_url":"https://api.github.com/users/AdamWill/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T22:30:24Z","updated_at":"2016-04-20T22:30:24Z","body":"https://github.com/mwclient/mwclient/pull/114 addresses this."}}