[Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)

Carl Johnson cmjohnson.mailinglist at gmail.com
Tue Mar 17 10:30:12 CET 2009

Greg Ewing wrote:

> Concerning the difficulty of exchanging "." and "," by
> post-processing, it might be generally useful to have
> a swap(s1, s2) method on strings that would replace
> occurrences of s1 by s2 and vice versa.

I would appreciate having that. There are a lot of small jobs where
str.translate and re are overkill, but s.replace(s1, TEMPCHAR); is
awkward, since you're not sure what you can safely use as a tempchar.

-- Carl Johnson

More information about the Python-ideas mailing list