jenkins-bot submitted this change.
[doc] Fix documentation for Site.watched_pages
Bug: T330799
Change-Id: I941de05e2e6298bbbb41d0ca8e6fe0a109206549
---
M pywikibot/site/_generators.py
1 file changed, 19 insertions(+), 6 deletions(-)
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',
To view, visit change 894210. To unsubscribe, or for help writing mail filters, visit settings.