[Python-ideas] in str.replace(old, new), allow 'old' to accept a tuple

Ben Finney ben+python at benfinney.id.au
Thu Apr 12 06:33:51 CEST 2012


Greg Ewing <greg.ewing at canterbury.ac.nz> writes:

> An obvious thing to do is to try them in the order they appear in the
> sequence. That would argue against allowing an unordered collection.

For that reason, I'm −0.5 on the proposal. If we're to specify multiple
match patterns and do them all in a single operation, I'd prefer to
specify them in e.g. a set or some other efficient non-ordered
collection.

-- 
 \     “On the other hand, you have different fingers.” —Steven Wright |
  `\                                                                   |
_o__)                                                                  |
Ben Finney




More information about the Python-ideas mailing list