RPI2026F1 created this task. RPI2026F1 added projects: Pywikibot, Pywikibot-Wikidata. Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION **Feature summary** (what you would like to be able to do and where): `pywikibot.pagegenerators` has a `WikidataSPARQLPageGenerator` generator that returns either entity pages or normal pages depending on if the site given is a `DataSite` or just a normal `Site`. **Use case(s)** (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution): Looking through the code, there are two cases: Case 1: When the site is a `DataSite`, it will return an iterator of `ItemPage`s, `PropertyPage`s, and/or `LexemePage`s, depending on the query Case 2: Where the site is not a `DataSite`, it will return an iterator of `Page`s that are the sitelinks of any items that would be returned in Case 1. This presents a very obvious opportunity for using `@typing.overload` and making two function type signatures. **Benefits** (why should this be implemented?): Static type checkers would now have a much easier time when working with the first case, since there is very little one can do with an item when knowing it's a `Page` object since you cannot actually manipulate the item. TASK DETAIL https://phabricator.wikimedia.org/T330716 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: RPI2026F1 Cc: Aklapper, pywikibot-bugs-list, RPI2026F1, PotsdamLamb, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, Ricordisamoa, Masti, Alchimista
_______________________________________________ pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org