Commit 2604107e authored by Stefan Behnel's avatar Stefan Behnel

Use "\x20" instead of a plain space at the end of a doctest output line to...

Use "\x20" instead of a plain space at the end of a doctest output line to make it easier to edit. Some editors strip off trailing whitespace.
parent 811e5adb
...@@ -56,11 +56,11 @@ def split_sep(unicode s, sep): ...@@ -56,11 +56,11 @@ def split_sep(unicode s, sep):
>>> print_all( text.split(sep) ) >>> print_all( text.split(sep) )
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
>>> print_all( split_sep(text, sep) ) >>> print_all( split_sep(text, sep) )
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
""" """
return s.split(sep) return s.split(sep)
...@@ -74,10 +74,10 @@ def split_sep_max(unicode s, sep, max): ...@@ -74,10 +74,10 @@ def split_sep_max(unicode s, sep, max):
""" """
>>> print_all( text.split(sep, 1) ) >>> print_all( text.split(sep, 1) )
ab jd ab jd
sdflk as sa sadas asdas fsdf sdflk as sa sadas asdas fsdf\x20
>>> print_all( split_sep_max(text, sep, 1) ) >>> print_all( split_sep_max(text, sep, 1) )
ab jd ab jd
sdflk as sa sadas asdas fsdf sdflk as sa sadas asdas fsdf\x20
""" """
return s.split(sep, max) return s.split(sep, max)
...@@ -90,10 +90,10 @@ def split_sep_max_int(unicode s, sep): ...@@ -90,10 +90,10 @@ def split_sep_max_int(unicode s, sep):
""" """
>>> print_all( text.split(sep, 1) ) >>> print_all( text.split(sep, 1) )
ab jd ab jd
sdflk as sa sadas asdas fsdf sdflk as sa sadas asdas fsdf\x20
>>> print_all( split_sep_max_int(text, sep) ) >>> print_all( split_sep_max_int(text, sep) )
ab jd ab jd
sdflk as sa sadas asdas fsdf sdflk as sa sadas asdas fsdf\x20
""" """
return s.split(sep, 1) return s.split(sep, 1)
...@@ -109,13 +109,13 @@ def splitlines(unicode s): ...@@ -109,13 +109,13 @@ def splitlines(unicode s):
>>> print_all( multiline_text.splitlines() ) >>> print_all( multiline_text.splitlines() )
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
>>> len(splitlines(multiline_text)) >>> len(splitlines(multiline_text))
3 3
>>> print_all( splitlines(multiline_text) ) >>> print_all( splitlines(multiline_text) )
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
""" """
return s.splitlines() return s.splitlines()
...@@ -130,7 +130,7 @@ def splitlines_keep(unicode s, keep): ...@@ -130,7 +130,7 @@ def splitlines_keep(unicode s, keep):
<BLANKLINE> <BLANKLINE>
sdflk as sa sdflk as sa
<BLANKLINE> <BLANKLINE>
sadas asdas fsdf sadas asdas fsdf\x20
>>> len(splitlines_keep(multiline_text, True)) >>> len(splitlines_keep(multiline_text, True))
3 3
>>> print_all( splitlines_keep(multiline_text, True) ) >>> print_all( splitlines_keep(multiline_text, True) )
...@@ -138,7 +138,7 @@ def splitlines_keep(unicode s, keep): ...@@ -138,7 +138,7 @@ def splitlines_keep(unicode s, keep):
<BLANKLINE> <BLANKLINE>
sdflk as sa sdflk as sa
<BLANKLINE> <BLANKLINE>
sadas asdas fsdf sadas asdas fsdf\x20
""" """
return s.splitlines(keep) return s.splitlines(keep)
...@@ -156,11 +156,11 @@ def splitlines_keep_bint(unicode s): ...@@ -156,11 +156,11 @@ def splitlines_keep_bint(unicode s):
<BLANKLINE> <BLANKLINE>
sdflk as sa sdflk as sa
<BLANKLINE> <BLANKLINE>
sadas asdas fsdf sadas asdas fsdf\x20
>>> print_all( multiline_text.splitlines(False) ) >>> print_all( multiline_text.splitlines(False) )
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
>>> len(splitlines_keep_bint(multiline_text)) >>> len(splitlines_keep_bint(multiline_text))
7 7
>>> print_all( splitlines_keep_bint(multiline_text) ) >>> print_all( splitlines_keep_bint(multiline_text) )
...@@ -168,11 +168,11 @@ def splitlines_keep_bint(unicode s): ...@@ -168,11 +168,11 @@ def splitlines_keep_bint(unicode s):
<BLANKLINE> <BLANKLINE>
sdflk as sa sdflk as sa
<BLANKLINE> <BLANKLINE>
sadas asdas fsdf sadas asdas fsdf\x20
-- --
ab jd ab jd
sdflk as sa sdflk as sa
sadas asdas fsdf sadas asdas fsdf\x20
""" """
return s.splitlines(True) + ['--'] + s.splitlines(False) return s.splitlines(True) + ['--'] + s.splitlines(False)
...@@ -669,9 +669,9 @@ def count_start_end(unicode s, substring, start, end): ...@@ -669,9 +669,9 @@ def count_start_end(unicode s, substring, start, end):
def replace(unicode s, substring, repl): def replace(unicode s, substring, repl):
""" """
>>> print( text.replace('sa', 'SA') ) >>> print( text.replace('sa', 'SA') )
ab jd sdflk as SA SAdas asdas fsdf ab jd sdflk as SA SAdas asdas fsdf\x20
>>> print( replace(text, 'sa', 'SA') ) >>> print( replace(text, 'sa', 'SA') )
ab jd sdflk as SA SAdas asdas fsdf ab jd sdflk as SA SAdas asdas fsdf\x20
""" """
return s.replace(substring, repl) return s.replace(substring, repl)
...@@ -683,8 +683,8 @@ def replace(unicode s, substring, repl): ...@@ -683,8 +683,8 @@ def replace(unicode s, substring, repl):
def replace_maxcount(unicode s, substring, repl, maxcount): def replace_maxcount(unicode s, substring, repl, maxcount):
""" """
>>> print( text.replace('sa', 'SA', 1) ) >>> print( text.replace('sa', 'SA', 1) )
ab jd sdflk as SA sadas asdas fsdf ab jd sdflk as SA sadas asdas fsdf\x20
>>> print( replace_maxcount(text, 'sa', 'SA', 1) ) >>> print( replace_maxcount(text, 'sa', 'SA', 1) )
ab jd sdflk as SA sadas asdas fsdf ab jd sdflk as SA sadas asdas fsdf\x20
""" """
return s.replace(substring, repl, maxcount) return s.replace(substring, repl, maxcount)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment