From 2ebad3088e83ada049dd035f89bf02e768e20afc Mon Sep 17 00:00:00 2001 From: Lukas Juhrich <lukasjuhrich@wh2.tu-dresden.de> Date: Sun, 24 Jul 2016 02:12:24 +0200 Subject: [PATCH] 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. --- mwclient/listing.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mwclient/listing.py b/mwclient/listing.py index 7cb581e..2e626e7 100644 --- a/mwclient/listing.py +++ b/mwclient/listing.py @@ -67,9 +67,9 @@ class List(object): self.load_chunk() return self.__next__(full=full) - def next(self, full=False): + def next(self, *args, **kwargs): """ For Python 2.x support """ - return self.__next__(full) + return self.__next__(*args, **kwargs) def load_chunk(self): """Query a new chunk of data @@ -169,10 +169,6 @@ class GeneratorList(List): return mwclient.image.Image(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): # Put this here so that the constructor does not fail # on uninitialized sites -- GitLab