Skip to content

Commit 7fdbfab

Browse files
clarify valid key types in print_stats method
Co-authored-by: Ege Akman <[email protected]>
1 parent b083716 commit 7fdbfab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Doc/library/profile.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,12 @@ functions:
301301

302302
The *sort* parameter specifies the sorting order of the displayed
303303
statistics. It accepts a single key or a tuple of keys to enable
304-
multi-level sorting. A key can be either an integer, a string, or a
305-
SortKey enum identifying the basis of a sort (for example: ``-1``,
306-
``'time'``, ``'name'``, ``SortKey.TIME``, or ``SortKey.NAME``).
304+
multi-level sorting. When passing a tuple of keys, each key must be
305+
either a string or a SortKey enum, excluding integers. However,
306+
if only a single key is provided, it can be an integer, a string, or a
307+
SortKey enum. These keys serve to identify the basis of the sort,
308+
such as ``'time'``, ``'name'``, ``SortKey.TIME``, or ``SortKey.NAME``,
309+
among others."
307310

308311
.. versionadded:: 3.13
309312
:meth:`~Profile.print_stats` now accepts a single key or a tuple of keys.

0 commit comments

Comments
 (0)