Version-Specific Features

Python 3.15 — Profiling package

The profiling package groups deterministic tracing and statistical sampling tools. cProfile remains a compatibility alias; profile is deprecated with removal planned for 3.17. Select a method based on measurement needs rather than treating sampled counts as exact call counts. Requires Python 3.15 or the relevant build; example is not executed locally.

Formal Syntax & Structure

python syntaxpython
profiling.tracing / profiling.sampling

Return Value

Feature-specific

No single return type; see the example and feature description.

Working Example

Example Snippetpython
import profiling.tracingimport profiling.samplingprint('profilers imported')
Python Reference