jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/594524 )
Change subject: [IMPR] Faster lookup for write actions ......................................................................
[IMPR] Faster lookup for write actions
Use a set instead a tuple for loopup which is upto 20 times faster.
Change-Id: I5b767a94a4352ff376d369cf11dc19be14dda09e --- M pywikibot/data/api.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, but someone else must approve Framawiki: Looks good to me, but someone else must approve Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index d65bf7e..cca8864 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1221,7 +1221,7 @@ # Actions that imply database updates on the server, used for various # things like throttling or skipping actions when we're in simulation # mode - self.write = self.action in ( + self.write = self.action in { 'block', 'clearhasmsg', 'createaccount', 'delete', 'edit', 'emailuser', 'filerevert', 'flowthank', 'imagerotate', 'import', 'managetags', 'mergehistory', 'move', 'options', 'patrol', @@ -1233,7 +1233,7 @@ 'wbremovequalifiers', 'wbremovereferences', 'wbsetaliases', 'wbsetclaim', 'wbsetclaimvalue', 'wbsetdescription', 'wbsetlabel', 'wbsetqualifier', 'wbsetreference', 'wbsetsitelink', - ) + } # Client side verification that the request is being performed # by a logged in user, and warn if it isn't a config username. if self.write:
pywikibot-commits@lists.wikimedia.org