Page MenuHomePhabricator

Refactor get_best_claim function
Closed, ResolvedPublic

Description

Move get_best_claim to ItemPage and keep a wrapper in Page, per the discussion in the comments.

Details

Event Timeline

Strainu renamed this task from Add getBestValueForClaim API to Create get_best_value_for_claim function.
Strainu renamed this task from Create get_best_value_for_claim function to Create get_best_value function.
Strainu triaged this task as Low priority.

Function already existing in class Page

@Xqt , why did you choose to implement this directly in Page instead of ItemPage with a wrapper on top in Page? Is it OK if I move it?

@Xqt , why did you choose to implement this directly in Page instead of ItemPage with a wrapper on top in Page? Is it OK if I move it?

Hi @Strainu, this was implemented 8 years ago for T175207 and I don’t remember the reasons why it was done on that way. Possibly you find some hints in the code reviews. Anyway any improvements are welcome and you can change the implementation in such way you proposed above.

Strainu renamed this task from Create get_best_value function to Refactor get_best_claim function.Jul 28 2025, 8:15 PM
Strainu reopened this task as Open.
Strainu updated the task description. (Show Details)

Change #1173478 had a related patch set uploaded (by Strainu; author: Strainu):

[pywikibot/core@master] get_best_claim: Move implementation to ItemPage

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

Change #1173478 merged by jenkins-bot:

[pywikibot/core@master] get_best_claim: Move implementation to ItemPage

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