Skip to content

Commit 7bd4a0a

Browse files
committed
DOC - more py3builder doctest processor docstring
1 parent e272e79 commit 7bd4a0a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nisext/py3builder.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,35 @@ def doctest_markup(in_lines):
100100
101101
An <expr> beginning with "replace(" we take to be short for "line.replace(".
102102
103+
If <expr> is just 'bytes', then make all the strings in the selected line be
104+
byte strings.
105+
103106
Parameters
104107
----------
105108
in_lines : sequence of str
106109
107110
Returns
108111
-------
109112
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',)
110132
"""
111133
pos = 0
112134
lines = list(in_lines)

0 commit comments

Comments
 (0)