[Python-ideas] string.replace should accept a list as a first argument

Chris Angelico rosuav at gmail.com
Wed Oct 7 02:59:31 CEST 2015


On Wed, Oct 7, 2015 at 11:49 AM, Random832 <random832 at fastmail.com> wrote:
> Not sure how to get around that, other than by creating a general
> "structured regex" module, to build a compiled regex from an abstract
> regex syntax tree rather than a string. Which actually might not be the
> worst thing in the world. I think there are some Lisp dialects that have
> something like that.

Ooh, I like this idea. Kinda like the difference between building up
an SQL statement by escaping all your input, and using a parameterized
statement.

ChrisA


More information about the Python-ideas mailing list