diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a0621d4b0dbd09..8a34aabb9267d6 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1039,6 +1039,16 @@ always available. Unless explicitly noted otherwise, all variables are read-only Get the profiler function as set by :func:`setprofile`. + .. impl-detail:: + + The :func:`getprofile` function is intended only for implementing profilers + and similar tools. When a C profile function is in effect (for example, + one installed by ``cProfile``), the returned object is the internal + profiler object and not a callable suitable for passing to :func:`setprofile`. + As a result, saving and restoring the profiler state using + :func:`getprofile` and :func:`setprofile` may not work as expected when + C-based profilers are in use. + .. function:: gettrace()