Page MenuHomePhabricator

Remove several method in api.Request which are derived from MutableMapping
Closed, ResolvedPublic

Description

Request has some Python 3 implementation which should be dropped and the implementation of MutableMapping should be used instead:

  • items is inherited fom MutableMapping but the result is a dictionary view instead of a list
  • iteritems can be replaced by the inherited *items* method above
  • keys is inherited fom MutableMapping but the result is a dictionary view instead of a list

Event Timeline

Xqt renamed this task from Remove several method in api.Request wich are derived from MutableMapping to Remove several method in api.Request which are derived from MutableMapping.Jun 19 2022, 8:17 AM

I think you meant it has Python 2 implementation which should be dropped.
Indeed, the methods inherited from MutableMapping do the trick, so the three methods defined in the Request class should simply be removed.

Indeed, the methods inherited from MutableMapping do the trick, so the three methods defined in the Request class should simply be removed.

This might be a breaking change; therefore we should wait for the next major release.

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

[pywikibot/core@master] [cleanup] remove keys() and items() methods of api.Request

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

Change 981476 merged by jenkins-bot:

[pywikibot/core@master] [cleanup] remove keys() and items() methods of api.Request

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