jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/894210 )
Change subject: [doc] Fix documentation for Site.watched_pages ......................................................................
[doc] Fix documentation for Site.watched_pages
Bug: T330799 Change-Id: I941de05e2e6298bbbb41d0ca8e6fe0a109206549 --- M pywikibot/site/_generators.py 1 file changed, 19 insertions(+), 6 deletions(-)
Approvals: Bináris: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py index 99a75e7..cdb796a 100644 --- a/pywikibot/site/_generators.py +++ b/pywikibot/site/_generators.py @@ -2110,18 +2110,21 @@ return self._generator(api.PageGenerator, type_arg='pageswithprop', gpwppropname=propname, total=total)
- def watched_pages(self, force: bool = False, total=None): - """ - Return watchlist. + def watched_pages( + self, + force: bool = False, + total: Optional[int] = None + ) -> Generator['pywikibot.Page', Any, None]: + """Return watchlist.
+ .. note:: ``watched_pages`` is a restartable generator. See + :class:`tools.collections.GeneratorWrapper` for its usage. .. seealso:: :api:`Watchlistraw`
:param force: Reload watchlist :param total: if not None, limit the generator to yielding this many items in total - :type total: int - :return: list of pages in watchlist - :rtype: list of pywikibot.Page objects + :return: generator of pages in watchlist """ expiry = None if force else pywikibot.config.API_config_expiry gen = api.PageGenerator(site=self, generator='watchlistraw',
pywikibot-commits@lists.wikimedia.org