Skip to content

Commit 2a56c6d

Browse files
committed
s/show_lines/show_source_lines/
1 parent 63113e7 commit 2a56c6d

File tree

5 files changed

+156
-146
lines changed

5 files changed

+156
-146
lines changed

Doc/library/traceback.rst

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The module's API can be divided into two parts:
5252
Module-Level Functions
5353
----------------------
5454

55-
.. function:: print_tb(tb, limit=None, file=None, *, show_lines=True, recent_first=False)
55+
.. function:: print_tb(tb, limit=None, file=None, *, show_source_lines=True, recent_first=False)
5656

5757
Print up to *limit* stack trace entries from
5858
:ref:`traceback object <traceback-objects>` *tb* (starting
@@ -63,7 +63,7 @@ Module-Level Functions
6363
:term:`file <file object>` or :term:`file-like object` to
6464
receive the output.
6565

66-
If *show_lines* is true (the default), source code lines will be included in the output.
66+
If *show_source_lines* is true (the default), source code lines will be included in the output.
6767

6868
If *recent_first* is true, the most recent stack trace entries are printed
6969
first, otherwise the oldest entries are printed first. The default is false.
@@ -85,11 +85,11 @@ Module-Level Functions
8585
Added negative *limit* support.
8686

8787
.. versionchanged:: next
88-
Added the *show_lines* and *recent_first* parameters.
88+
Added the *show_source_lines* and *recent_first* parameters.
8989

9090

9191
.. function:: print_exception(exc, /[, value, tb], limit=None, \
92-
file=None, chain=True, *, show_lines=True, recent_first=False)
92+
file=None, chain=True, *, show_source_lines=True, recent_first=False)
9393
9494
Print exception information and stack trace entries from
9595
:ref:`traceback object <traceback-objects>`
@@ -118,7 +118,7 @@ Module-Level Functions
118118
printed as well, like the interpreter itself does when printing an unhandled
119119
exception.
120120

121-
If *show_lines* is true, source code lines are included in the output.
121+
If *show_source_lines* is true, source code lines are included in the output.
122122

123123
If *recent_first* is true, the most recent stack trace entries are printed
124124
first, otherwise the oldest entries are printed first. The default is false.
@@ -131,45 +131,45 @@ Module-Level Functions
131131
positional-only.
132132

133133
.. versionchanged:: next
134-
Added the *show_lines* and *recent_first* parameters.
134+
Added the *show_source_lines* and *recent_first* parameters.
135135

136136

137-
.. function:: print_exc(limit=None, file=None, chain=True, *, show_lines=True, recent_first=False)
137+
.. function:: print_exc(limit=None, file=None, chain=True, *, show_source_lines=True, recent_first=False)
138138

139139
This is a shorthand for ``print_exception(sys.exception(), limit=limit, file=file,
140-
chain=chain, show_lines=show_lines, recent_first=recent_first)``.
140+
chain=chain, show_source_lines=show_source_lines, recent_first=recent_first)``.
141141

142142
.. versionchanged:: next
143-
Added the *show_lines* and *recent_first* parameters.
143+
Added the *show_source_lines* and *recent_first* parameters.
144144

145145

146-
.. function:: print_last(limit=None, file=None, chain=True, *, show_lines=True, recent_first=False)
146+
.. function:: print_last(limit=None, file=None, chain=True, *, show_source_lines=True, recent_first=False)
147147

148148
This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file,
149-
chain=chain, show_lines=show_lines, recent_first=recent_first)``.
149+
chain=chain, show_source_lines=show_source_lines, recent_first=recent_first)``.
150150
In general it will work only after an exception has reached an interactive
151151
prompt (see :data:`sys.last_exc`).
152152

153153
.. versionchanged:: next
154-
Added the *show_lines* and *recent_first* parameters.
154+
Added the *show_source_lines* and *recent_first* parameters.
155155

156156

157-
.. function:: print_stack(f=None, limit=None, file=None, *, show_lines=True, recent_first=False)
157+
.. function:: print_stack(f=None, limit=None, file=None, *, show_source_lines=True, recent_first=False)
158158

159159
Print up to *limit* stack trace entries (starting from the invocation
160160
point) if *limit* is positive. Otherwise, print the last ``abs(limit)``
161161
entries. If *limit* is omitted or ``None``, all entries are printed.
162162
The optional *f* argument can be used to specify an alternate
163163
:ref:`stack frame <frame-objects>`
164164
to start. The optional *file* argument has the same meaning as for
165-
:func:`print_tb`. If *show_lines* is true, source code lines are
165+
:func:`print_tb`. If *show_source_lines* is true, source code lines are
166166
included in the output.
167167

168168
.. versionchanged:: 3.5
169169
Added negative *limit* support.
170170

171171
.. versionchanged:: next
172-
Added the *show_lines* and *recent_first* parameters.
172+
Added the *show_source_lines* and *recent_first* parameters.
173173

174174

175175
.. function:: extract_tb(tb, limit=None)
@@ -193,29 +193,29 @@ Module-Level Functions
193193
arguments have the same meaning as for :func:`print_stack`.
194194

195195

196-
.. function:: print_list(extracted_list, file=None, *, show_lines=True)
196+
.. function:: print_list(extracted_list, file=None, *, show_source_lines=True)
197197

198198
Print the list of tuples as returned by :func:`extract_tb` or
199199
:func:`extract_stack` as a formatted stack trace to the given file.
200200
If *file* is ``None``, the output is written to :data:`sys.stderr`.
201-
If *show_lines* is true, source code lines are included in the output.
201+
If *show_source_lines* is true, source code lines are included in the output.
202202

203203
.. versionchanged:: next
204-
Added the *show_lines* parameter.
204+
Added the *show_source_lines* parameter.
205205

206206

207-
.. function:: format_list(extracted_list, *, show_lines=True)
207+
.. function:: format_list(extracted_list, *, show_source_lines=True)
208208

209209
Given a list of tuples or :class:`FrameSummary` objects as returned by
210210
:func:`extract_tb` or :func:`extract_stack`, return a list of strings ready
211211
for printing. Each string in the resulting list corresponds to the item with
212212
the same index in the argument list. Each string ends in a newline; the
213213
strings may contain internal newlines as well, for those items whose source
214-
text line is not ``None``. If *show_lines* is ``True``, source code lines
214+
text line is not ``None``. If *show_source_lines* is ``True``, source code lines
215215
are included in the output.
216216

217217
.. versionchanged:: next
218-
Added the *show_lines* parameter.
218+
Added the *show_source_lines* parameter.
219219

220220

221221
.. function:: format_exception_only(exc, /[, value], *, show_group=False)
@@ -248,15 +248,15 @@ Module-Level Functions
248248
*show_group* parameter was added.
249249

250250

251-
.. function:: format_exception(exc, /[, value, tb], limit=None, chain=True, *, show_lines=True, recent_first=False, show_group=False)
251+
.. function:: format_exception(exc, /[, value, tb], limit=None, chain=True, *, show_source_lines=True, recent_first=False, show_group=False)
252252

253253
Format a stack trace and the exception information. The arguments have the
254254
same meaning as the corresponding arguments to :func:`print_exception`. The
255255
return value is a list of strings, each ending in a newline and some
256256
containing internal newlines. When these lines are concatenated and printed,
257257
exactly the same text is printed as does :func:`print_exception`.
258258

259-
If *show_lines* is true, source code lines are included in the output.
259+
If *show_source_lines* is true, source code lines are included in the output.
260260
If *recent_first* is true, the most recent stack trace entries are printed
261261
first, otherwise the oldest entries are printed first. The default is false.
262262

@@ -268,40 +268,40 @@ Module-Level Functions
268268
:func:`print_exception`.
269269

270270
.. versionchanged:: next
271-
Added the *show_lines* and *recent_first* parameters.
271+
Added the *show_source_lines* and *recent_first* parameters.
272272

273273

274-
.. function:: format_exc(limit=None, chain=True, *, show_lines=True, recent_first=False)
274+
.. function:: format_exc(limit=None, chain=True, *, show_source_lines=True, recent_first=False)
275275

276276
This is like ``print_exc(limit)`` but returns a string instead of printing to
277277
a file.
278278

279-
If *show_lines* is true, source code lines are included in the output.
279+
If *show_source_lines* is true, source code lines are included in the output.
280280
If *recent_first* is true, the most recent stack trace entries are printed
281281
first, otherwise the oldest entries are printed first. The default is false.
282282

283283
.. versionchanged:: next
284-
Added the *show_lines* and *recent_first* parameters.
284+
Added the *show_source_lines* and *recent_first* parameters.
285285

286286

287-
.. function:: format_tb(tb, limit=None, *, show_lines=True, recent_first=False)
287+
.. function:: format_tb(tb, limit=None, *, show_source_lines=True, recent_first=False)
288288

289-
A shorthand for ``format_list(extract_tb(tb, limit), show_lines=show_lines)``.
289+
A shorthand for ``format_list(extract_tb(tb, limit), show_source_lines=show_source_lines)``.
290290

291291
If *recent_first* is true, ``reversed(extract_tb(tb, limit))`` is used.
292292

293293
.. versionchanged:: next
294-
Added the *show_lines* and *recent_first* parameters.
294+
Added the *show_source_lines* and *recent_first* parameters.
295295

296296

297-
.. function:: format_stack(f=None, limit=None, *, show_lines=True, recent_first=False)
297+
.. function:: format_stack(f=None, limit=None, *, show_source_lines=True, recent_first=False)
298298

299-
A shorthand for ``format_list(extract_stack(f, limit), show_lines=show_lines)``.
299+
A shorthand for ``format_list(extract_stack(f, limit), show_source_lines=show_source_lines)``.
300300

301301
If *recent_first* is true, ``reversed(extract_stack(f, limit))`` is used.
302302

303303
.. versionchanged:: next
304-
Added the *show_lines* and *recent_first* parameters.
304+
Added the *show_source_lines* and *recent_first* parameters.
305305

306306
.. function:: clear_frames(tb)
307307

@@ -375,7 +375,7 @@ the module-level functions described above.
375375

376376
.. versionchanged:: next
377377
Changed *lookup_lines* default to ``False`` to avoid overhead when
378-
formatting exceptions with ``show_lines=False``.
378+
formatting exceptions with ``show_source_lines=False``.
379379

380380
.. attribute:: __cause__
381381

@@ -468,14 +468,14 @@ the module-level functions described above.
468468

469469
.. versionchanged:: next
470470
Changed *lookup_lines* default to ``False`` to avoid overhead when
471-
formatting exceptions with ``show_lines=False``.
471+
formatting exceptions with ``show_source_lines=False``.
472472

473-
.. method:: print(*, file=None, chain=True, show_lines=True, recent_first=False)
473+
.. method:: print(*, file=None, chain=True, show_source_lines=True, recent_first=False)
474474

475475
Print to *file* (default ``sys.stderr``) the exception information returned by
476476
:meth:`format`.
477477

478-
If *show_lines* is true, source code lines are included in the output.
478+
If *show_source_lines* is true, source code lines are included in the output.
479479

480480
If *recent_first* is true, the exception is printed first followed by stack
481481
trace by "most recent call first" order.
@@ -485,9 +485,9 @@ the module-level functions described above.
485485
.. versionadded:: 3.11
486486

487487
.. versionchanged:: next
488-
Added the *show_lines* and *recent_first* parameters.
488+
Added the *show_source_lines* and *recent_first* parameters.
489489

490-
.. method:: format(*, chain=True, show_lines=True, recent_first=False)
490+
.. method:: format(*, chain=True, show_source_lines=True, recent_first=False)
491491

492492
Format the exception.
493493

@@ -498,15 +498,15 @@ the module-level functions described above.
498498
some containing internal newlines. :func:`~traceback.print_exception`
499499
is a wrapper around this method which just prints the lines to a file.
500500

501-
If *show_lines* is true, source code lines are included in the output.
501+
If *show_source_lines* is true, source code lines are included in the output.
502502

503503
If *recent_first* is true, the exception is printed first followed by stack
504504
trace by "most recent call first" order.
505505
Otherwise, the stack trace is printed first by "most recent call last" order
506506
followed by the exception.
507507

508508
.. versionchanged:: next
509-
Added the *show_lines* and *recent_first* parameters.
509+
Added the *show_source_lines* and *recent_first* parameters.
510510

511511
.. method:: format_exception_only(*, show_group=False)
512512

@@ -561,7 +561,7 @@ the module-level functions described above.
561561

562562
.. versionchanged:: next
563563
Changed *lookup_lines* default to ``False`` to avoid overhead when
564-
formatting traceback with ``show_lines=False``.
564+
formatting traceback with ``show_source_lines=False``.
565565

566566
.. classmethod:: from_list(a_list)
567567

@@ -570,7 +570,7 @@ the module-level functions described above.
570570
should be a 4-tuple with *filename*, *lineno*, *name*, *line* as the
571571
elements.
572572

573-
.. method:: format(*, show_lines=True)
573+
.. method:: format(*, show_source_lines=True)
574574

575575
Returns a list of strings ready for printing. Each string in the
576576
resulting list corresponds to a single :ref:`frame <frame-objects>` from
@@ -582,29 +582,29 @@ the module-level functions described above.
582582
repetitions are shown, followed by a summary line stating the exact
583583
number of further repetitions.
584584

585-
If *show_lines* is true, includes source code lines in the output.
585+
If *show_source_lines* is true, includes source code lines in the output.
586586

587587
.. versionchanged:: 3.6
588588
Long sequences of repeated frames are now abbreviated.
589589

590590
.. versionchanged:: next
591-
Added the *show_lines* parameter.
591+
Added the *show_source_lines* parameter.
592592

593-
.. method:: format_frame_summary(frame_summary, *, show_lines=True, **kwargs)
593+
.. method:: format_frame_summary(frame_summary, *, show_source_lines=True, **kwargs)
594594

595595
Returns a string for printing one of the :ref:`frames <frame-objects>`
596596
involved in the stack.
597597
This method is called for each :class:`FrameSummary` object to be
598598
printed by :meth:`StackSummary.format`. If it returns ``None``, the
599599
frame is omitted from the output.
600600

601-
The keyword argument *show_lines*, if ``True``, includes source code
601+
The keyword argument *show_source_lines*, if ``True``, includes source code
602602
lines in the output.
603603

604604
.. versionadded:: 3.11
605605

606606
.. versionchanged:: next
607-
Added the *show_lines* parameter.
607+
Added the *show_source_lines* parameter.
608608

609609

610610
:class:`!FrameSummary` Objects

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ tarfile
305305
traceback
306306
----------
307307

308-
* Add new *show_lines* and *recent_first* keyword only arguments to
308+
* Add new *show_source_lines* and *recent_first* keyword only arguments to
309309
the :mod:`traceback` functions.
310310

311-
The *show_lines* argument controls whether source code lines are displayed.
311+
The *show_source_lines* argument controls whether source code lines are displayed.
312312
It is default to ``True``.
313313

314314
The *recent_first* argument controls whether the most recent frames are

0 commit comments

Comments
 (0)