File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,35 @@ def doctest_markup(in_lines):
100
100
101
101
An <expr> beginning with "replace(" we take to be short for "line.replace(".
102
102
103
+ If <expr> is just 'bytes', then make all the strings in the selected line be
104
+ byte strings.
105
+
103
106
Parameters
104
107
----------
105
108
in_lines : sequence of str
106
109
107
110
Returns
108
111
-------
109
112
out_lines : sequence of str
113
+
114
+ Examples
115
+ --------
116
+ The next three lines all do the same thing. The # at the beginning disables
117
+ them as runnable doctests in this docstring.
118
+
119
+ # >>> a = '1234567890' #2to3: here; line.replace("'12", "b'12")
120
+ # >>> a = '1234567890' #2to3: here; replace("'12", "b'12")
121
+ # >>> a = '1234567890' #2to3: here; bytes
122
+
123
+ You might want to process the next line
124
+
125
+ # >>> upk.unpack('2s') #2to3: next; bytes
126
+ # ('12',)
127
+
128
+ This might work too, to do the same thing:
129
+
130
+ # >>> upk.unpack('2s') #2to3: here+1; bytes
131
+ # ('12',)
110
132
"""
111
133
pos = 0
112
134
lines = list (in_lines )
You can’t perform that action at this time.
0 commit comments