Dave Angel wrote: > On 03/02/2015 08:51 AM, alb wrote: >> Hi Steven, >> >> Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: >> [] >>> Since \r is an escape character, that will give you carriage return >>> followed by "ef{fig:abc". >>> >>> The solution to that is to either escape the backslash: >>> >>> i = '\\ref{fig:abc}' >>> >>> >>> or use a raw string: >>> >>> i = r'\\ref{fig:abc}' > > Actually that'd be: > i = r'\ref{fig:abc}'
D'oh! I mean, you spotted my deliberate mistake to check if you were paying attention. Well done! > How about "in" and "out"? Or perhaps some name that indicates what > semantics the string represents, like "rst_string" and "html_string" > or whatever they actually are? Can't use "in", it's a keyword. -- Steven -- https://mail.python.org/mailman/listinfo/python-list