Talin wrote:
>      Braces can be escaped using a backslash:
> 
>          "My name is {0} :-\{\}".format('Fred')
> 
>      Which would produce:
> 
>          "My name is Fred :-{}"

Do backslashes also need to be backslashed then?  If not, then what is 
the translation of this:?

     r'abc\{%s\}' % 'x'

I guess the only sensible translation if backslashes aren't backslashed 
would be:

     r'abc\\{{0}\\}'.format('x')

But the parsing of that format string seems fairly unintuitive to me. 
If backslashes do need to be backslashed, then that fact needs to be 
mentioned.

-Edward
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to