[issue33647] Add re.replace(string, replacement_map)

Chris Jerdonek report at bugs.python.org
Thu Oct 8 17:36:01 EDT 2020


Chris Jerdonek <chris.jerdonek at gmail.com> added the comment:

Another API option is to use str.replace's existing arguments: str.replace(old, new[, count]). In addition to "old" and "new" being strings, they could also be lists of strings of equal length, similar to how str.maketrans() can accept two strings of equal length. Then, like maketrans(), each string in "old" would be replaced by the corresponding string at the same position in "new."

----------
nosy: +chris.jerdonek

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33647>
_______________________________________


More information about the Python-bugs-list mailing list