Use bracket access for re.Match groups
ProprietaryReplace match.group(n) with match[n] to use the shorter subscript syntax available since Python 3.6. It only fires where the receiver's type resolves to re.Match and the group is one positional argument.
org. openrewrite. python. cleanup. UseGetitemForReMatchGroupsmod run . --recipe= org. openrewrite. python. cleanup. UseGetitemForReMatchGroupsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.