bpo-32017: Document differences between profile.Profile and cProfile.Profile#5887
Closed
bbayles wants to merge 4 commits intopython:masterfrom
Closed
bpo-32017: Document differences between profile.Profile and cProfile.Profile#5887bbayles wants to merge 4 commits intopython:masterfrom
bbayles wants to merge 4 commits intopython:masterfrom
Conversation
Contributor
Author
|
I've resolved conflicts on this, in case anybody is watching. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the
profilemodule's documentation to reflect some significant differences betweenprofile.ProfileandcProfile.Profile.For example, the current docs imply that the Python version has
enable()anddisable()methods - it doesn't. The two versions also have different__init__parameters (which are describe elsewhere in the document).In this version there is a section for each class, with the proper list of supported methods. I've also noted where the different classes have different behavior for the same method -
cProfile.Profile'sprint_stats()method needs to be initialized, for example.For convenience, the rendered docs look like this:
Motivating example
profile.Profile
cProfile.Profile
These changes could apply to Python 3.7 as well. Versions before that are also deficient, but need some more tweaking due to the addition of the
SortKeyenum.https://bugs.python.org/issue32017