-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-69990: Make Profile.print_stats support sorting by multiple values #104590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the modules documentation.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Doc/library/profile.rst
Outdated
to enable multi-level sorting. | ||
|
||
.. versionadded:: 3.13 | ||
:meth:`~Profile.print_stats` can now accept multiple sort arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can accept multiple sort arguments" looks confusing. Does print_stats('calls', 'time')
or print_stats(sort='calls', sort='time')
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
import cProfile
from pstats import SortKey
with cProfile.Profile() as pr:
pr.print_stats(sort=("time", "calls")) # or pr.print_stats(sort=(SortKey.TIME, SortKey.CALLS))
I believe that adding a small example to the documentation would make it easier to understand the feature. What do you think?
Co-authored-by: Ege Akman <[email protected]>
Co-authored-by: Ege Akman <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Ege Akman <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
|
The failure is unrelated, being fixed in #115557 |
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
Uh oh!
There was an error while loading. Please reload this page.