[Python-3000] Small renaming suggestion: re.sub() -> re.replace() or re.substitute()

Facundo Batista facundobatista at gmail.com
Fri Oct 5 12:45:54 CEST 2007


2007/10/5, Mark Summerfield <mark at qtrac.eu>:

> Although re.substitute() would work (and be better than sub), I think
> re.replace() is better and more consistent regarding the rest of the
> library.

+1, happened twice to me, different jobs, that a colleague came to me
asking why there was no "replace" in "re".

Yes, sub() is even difficult to find (unless you *read* all the
descriptions of the methods).

Regards,

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


More information about the Python-3000 mailing list