Terry J. Reedy <tjre...@udel.edu> added the comment:

Serhiy, Is there any reason to not combine last two lines in one?

-        regex = '(?P<%s>%s' % (directive, regex)
-        return '%s)' % regex
+        return '(?P<%s>%s)' % (directive, regex)

or to use f-string to then get

+        return f'(?P<{directive}>{regex})'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32801>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to