append special chars with "\"

Peter Hansen peter at engcorp.com
Wed Oct 1 13:42:28 EDT 2003


Alex Martelli wrote:
> 
> Christos TZOTZIOY Georgiou wrote:
> 
> > On Tue, 30 Sep 2003 07:58:27 GMT, rumours say that Alex Martelli
> > <aleax at aleax.it> might have written:
> >
> >>charmap = {}
> >>for c in chr: charmap[c] = c+'\\'
> >
> > I believe you meant charmap[c] = '\\' + c ...
> 
> Sure, if the original poster wants the backslash BEFORE the character
> (the "append" in the subject suggested to me he wanted it AFTER).

Even many native English speakers unfortunately seem to think that
"append" means merely "attach".  "Prepend" sounds to them as a foreign
word... only context can resolve the resulting problem.

-Peter




More information about the Python-list mailing list