Page MenuHomePhabricator

Make pagegenerators.GoogleSearchPageGenerator a Generator
Closed, ResolvedPublicFeature

Description

Feature summary:

pagegenerators.GoogleSearchPageGenerator should be a Generator as the class name says

Use case(s) :

Currenly pagegenerators.GoogleSearchPageGenerator is an Iterables; it works with for loops but it does not support next() function of an Iterator.

Benefits:

Making pagegenerators.GoogleSearchPageGenerator a collections.abc.Generator they are capable to be used as

  • Iterable (for loops etc.)
  • Iterator (next() function etc.)
  • Generator (close() method which is used by BaseBot; BaseBot tries to convert every Iterable to a Generator)

Event Timeline

Xqt changed the task status from Open to In Progress.Jul 24 2022, 8:03 AM
Xqt claimed this task.
Xqt triaged this task as Low priority.

Change 816286 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] Make GoogleSearchPageGenerator a abc.Generator

https://gerrit.wikimedia.org/r/816286

Change 816286 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Make GoogleSearchPageGenerator a abc.Generator

https://gerrit.wikimedia.org/r/816286