- Calling ItemPage.get shouldn't be necessary. When the programmer asks for eg. ItemPage.claims, it should first take a look if the entity has been loaded, and if not, load it. This is what happens when page.text is used.
- When the entity is loaded using ItemPage.get, all data is loaded and initialized, too. This creates potentially many unused objects in the memory (claims with values and sitelinks with site objects T226157). Let's only initialize those data attributes which the programmer cares about. Eventually, this could be more granular (eg. per property initialization).
- However, ItemPage.get is supposed to return a dictionary with all the data initialized. For backwards compatibility, it should become a "view" which will encapsulate all the above.
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
[IMPR] Create a SiteLink with __getitem__ method | pywikibot/core | master | +20 -12 | |
[IMPR] Load entities when necessary | pywikibot/core | master | +72 -7 |
Event Timeline
Comment Actions
Change 626640 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[pywikibot/core@master] [IMPR] Load entities when necessary
Comment Actions
Change 626640 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Load entities when necessary
Comment Actions
Change 660809 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Create a SiteLink with getitem method
Comment Actions
Change 660809 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Create a SiteLink with getitem method