Skip to content

Commit ca3fed7

Browse files
committed
Fix warnings
1 parent 1bcb081 commit ca3fed7

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

Doc/library/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following modules have a command-line interface.
1212
* :ref:`calendar <calendar-cli>`
1313
* :mod:`code`
1414
* :ref:`compileall <compileall-cli>`
15-
* :mod:`cProfile`: see :ref:`profiling.tracing <profiling-tracing-cli>`
15+
* ``cProfile``: see :ref:`profiling.tracing <profiling-tracing-cli>`
1616
* :ref:`dis <dis-cli>`
1717
* :ref:`doctest <doctest-cli>`
1818
* :mod:`!encodings.rot_13`

Doc/library/profile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ a straightforward migration path.
4949

5050
.. note::
5151

52-
The :mod:`cProfile` module remains available as a backward-compatible alias
52+
The ``cProfile`` module remains available as a backward-compatible alias
5353
to :mod:`profiling.tracing`. Existing code using ``import cProfile`` will
5454
continue to work without modification.
5555

Doc/library/profiling-tracing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ testing scenarios.
2121

2222
.. note::
2323

24-
This module is also available as :mod:`cProfile` for backward compatibility.
25-
The :mod:`cProfile` name will continue to work in all future Python versions.
24+
This module is also available as ``cProfile`` for backward compatibility.
25+
The ``cProfile`` name will continue to work in all future Python versions.
2626
Use whichever import style suits your codebase::
2727

2828
# Preferred (new style)
@@ -101,7 +101,7 @@ results to standard output (or saves them to a file).
101101
standard import mechanism.
102102

103103
.. versionadded:: 3.7
104-
The ``-m`` option for :mod:`cProfile`.
104+
The ``-m`` option for ``cProfile``.
105105

106106
.. versionadded:: 3.8
107107
The ``-m`` option for :mod:`profile`.
@@ -305,7 +305,7 @@ this latency, which can make them appear slower than they actually are. This
305305
error is typically less than one clock tick per call but can become
306306
significant for functions called many times.
307307

308-
The :mod:`profiling.tracing` module (and its :mod:`cProfile` alias) is
308+
The :mod:`profiling.tracing` module (and its ``cProfile`` alias) is
309309
implemented as a C extension with low overhead, so these timing issues are
310310
less pronounced than with the deprecated pure Python :mod:`profile` module.
311311

Doc/library/profiling.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _profiling:
1+
.. _profiling-module:
22

33
***************************************
44
:mod:`profiling` --- Python Profilers
@@ -80,22 +80,22 @@ function calls.
8080

8181
The following table summarizes the key differences:
8282

83-
+-------------------+--------------------------+----------------------+
84-
| Feature | Statistical Sampling | Deterministic |
85-
| | (:mod:`profiling.sampling`) | (:mod:`profiling.tracing`) |
86-
+===================+==========================+======================+
87-
| **Target** | Running process | Code you run |
88-
+-------------------+--------------------------+----------------------+
89-
| **Overhead** | Virtually none | Moderate |
90-
+-------------------+--------------------------+----------------------+
91-
| **Accuracy** | Statistical estimate | Exact call counts |
92-
+-------------------+--------------------------+----------------------+
93-
| **Setup** | Attach to any PID | Instrument code |
94-
+-------------------+--------------------------+----------------------+
95-
| **Use Case** | Production debugging | Development/testing |
96-
+-------------------+--------------------------+----------------------+
97-
| **Implementation**| C extension | C extension |
98-
+-------------------+--------------------------+----------------------+
83+
+--------------------+------------------------------+------------------------------+
84+
| Feature | Statistical Sampling | Deterministic |
85+
| | (:mod:`profiling.sampling`) | (:mod:`profiling.tracing`) |
86+
+====================+==============================+==============================+
87+
| **Target** | Running process | Code you run |
88+
+--------------------+------------------------------+------------------------------+
89+
| **Overhead** | Virtually none | Moderate |
90+
+--------------------+------------------------------+------------------------------+
91+
| **Accuracy** | Statistical estimate | Exact call counts |
92+
+--------------------+------------------------------+------------------------------+
93+
| **Setup** | Attach to any PID | Instrument code |
94+
+--------------------+------------------------------+------------------------------+
95+
| **Use Case** | Production debugging | Development/testing |
96+
+--------------------+------------------------------+------------------------------+
97+
| **Implementation** | C extension | C extension |
98+
+--------------------+------------------------------+------------------------------+
9999

100100

101101
When to Use Statistical Sampling
@@ -227,14 +227,14 @@ filename:lineno(function)
227227
Legacy Compatibility
228228
====================
229229

230-
For backward compatibility, the :mod:`cProfile` module remains available as an
230+
For backward compatibility, the ``cProfile`` module remains available as an
231231
alias to :mod:`profiling.tracing`. Existing code using ``import cProfile`` will
232232
continue to work without modification in all future Python versions.
233233

234234
.. deprecated:: 3.15
235235

236236
The pure Python :mod:`profile` module is deprecated and will be removed in
237-
Python 3.17. Use :mod:`profiling.tracing` (or its alias :mod:`cProfile`)
237+
Python 3.17. Use :mod:`profiling.tracing` (or its alias ``cProfile``)
238238
instead. See :mod:`profile` for migration guidance.
239239

240240

Doc/library/pstats.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Reading and Displaying Profile Data
2121
===================================
2222

2323
The :class:`Stats` class is the primary interface for working with profile
24-
data. It can read statistics from files or directly from a :class:`Profile`
25-
object.
24+
data. It can read statistics from files or directly from a
25+
:class:`~profiling.tracing.Profile` object.
2626

2727
Load statistics from a file and print a basic report::
2828

@@ -269,7 +269,7 @@ The :class:`Stats` Class
269269
For each function in the filtered results, shows which functions called
270270
it and how often.
271271

272-
With :mod:`profiling.tracing` (or :mod:`cProfile`), each caller line
272+
With :mod:`profiling.tracing` (or ``cProfile``), each caller line
273273
shows three numbers: the number of calls from that caller, and the
274274
total and cumulative times for those specific calls.
275275

@@ -286,10 +286,10 @@ The :class:`Stats` Class
286286

287287
.. method:: get_stats_profile()
288288

289-
Return a :class:`StatsProfile` object containing the statistics.
289+
Return a ``StatsProfile`` object containing the statistics.
290290

291291
The returned object provides programmatic access to the profile data,
292-
with function names mapped to :class:`FunctionProfile` objects
292+
with function names mapped to ``FunctionProfile`` objects
293293
containing timing and call count information.
294294

295295
.. versionadded:: 3.9

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ A new :mod:`profiling` module has been added to organize Python's built-in
8686
profiling tools under a single, coherent namespace. This module contains:
8787

8888
* :mod:`profiling.tracing`: deterministic function-call tracing (relocated from
89-
:mod:`cProfile`).
89+
``cProfile``).
9090
* :mod:`profiling.sampling`: a new statistical sampling profiler (named Tachyon).
9191

92-
The :mod:`cProfile` module remains as an alias for backwards compatibility.
92+
The ``cProfile`` module remains as an alias for backwards compatibility.
9393
The :mod:`profile` module is deprecated and will be removed in Python 3.17.
9494

9595
.. seealso:: :pep:`799` for further details.

0 commit comments

Comments
 (0)