On Thu, Apr 13, 2017 at 11:36:56AM +0000, Guenter Milde wrote: > > Ther difference in backslash handling is due to the "r" praefix, not > depending on binary or not: > > rb'\n' <-> r'\n' > b'\n' <-> '\n'
Yes, I was aware of the meaning of the r prefix. > In Python, the backslash can be used for some replacements like > \n - newline, \t tab, \\ backslash ... > > In non-defined combinations (like \s) the backslash is kept and > "\s" == "\\s". This is what surprises me. I would expect an error in this case. -- Enrico