Page MenuHomePhabricator

Access match object groups by item name instead of group() method
Closed, ResolvedPublic

Description

Introduction

Match object groups can be accessed by __getitem__, which is equivalent to group(). So mo['name'] is now equivalent to mo.group('name').
https://docs.python.org/3.6/whatsnew/3.6.html#re

What to do

All occurrences of match.group('name') is to be replaced by the corresponding item access match['name'].
These issues can be found at https://codesearch.wmcloud.org/pywikibot/?q=%5C.group%5C((%27%5Cw%2B%27%7C%5B0-9a-zA-Z_%5D%2B)%5C)&i=nope&files=&excludeFiles=&repos=
Split patches into parts of only a couple of affected files. This makes it easier to review.

Useful links

Event Timeline

Change 881415 had a related patch set uploaded (by Ayush Anand33; author: Ayush Anand33):

[pywikibot/core@master] Access match object by name

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

Change 881415 merged by jenkins-bot:

[pywikibot/core@master] Access match object by name

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