On Fri, 2010-07-16 at 01:26 -0400, pyt...@bdurham.com wrote: > I understand what you're saying, but I'm struggling with how to > represent the following strings in doctest code and doctest results. > No > matter what combination of backslashes or raw strings I use, I am > unable > to find a way to code the following. > > >>> encode( '", \, \t, \n' ) > '\", \\, \\t, \\n'
>>> encode(', '.join([chr(i) for i in (34, 92, 9, 10)])) But, as another poster already said, if the limitations of doctests are causing you to struggle, then don't use doctests and instead use "real" tests. -- http://mail.python.org/mailman/listinfo/python-list