Skip to content
Snippets Groups Projects
Commit 2ebad308 authored by Lukas Juhrich's avatar Lukas Juhrich Committed by Dan Michael O. Heggø
Browse files

Improve `next` function alias

Since `next` is just there for compatability reasons, it is more
reusable be completely transparent, i.e. Passing every
[keyword]argument.

Now, we don't need to re-define it in the child class with a different
signature.
parent 1eb8a299
No related branches found
No related tags found
No related merge requests found
...@@ -67,9 +67,9 @@ class List(object): ...@@ -67,9 +67,9 @@ class List(object):
self.load_chunk() self.load_chunk()
return self.__next__(full=full) return self.__next__(full=full)
def next(self, full=False): def next(self, *args, **kwargs):
""" For Python 2.x support """ """ For Python 2.x support """
return self.__next__(full) return self.__next__(*args, **kwargs)
def load_chunk(self): def load_chunk(self):
"""Query a new chunk of data """Query a new chunk of data
...@@ -169,10 +169,6 @@ class GeneratorList(List): ...@@ -169,10 +169,6 @@ class GeneratorList(List):
return mwclient.image.Image(self.site, u'', info) return mwclient.image.Image(self.site, u'', info)
return mwclient.page.Page(self.site, u'', info) return mwclient.page.Page(self.site, u'', info)
def next(self):
""" For Python 2.x support """
return self.__next__()
def load_chunk(self): def load_chunk(self):
# Put this here so that the constructor does not fail # Put this here so that the constructor does not fail
# on uninitialized sites # on uninitialized sites
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment