Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cebe80b5
Commit
cebe80b5
authored
Jun 07, 2018
by
Scott Sanderson
Committed by
INADA Naoki
Jun 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29235: Update document for Profiler's context manager (GH-7331)
parent
fffeb6f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
Doc/library/profile.rst
Doc/library/profile.rst
+3
-0
Doc/whatsnew/3.8.rst
Doc/whatsnew/3.8.rst
+2
-0
Misc/NEWS.d/next/Library/2018-05-14-15-01-55.bpo-29235.47Fzwt.rst
...S.d/next/Library/2018-05-14-15-01-55.bpo-29235.47Fzwt.rst
+2
-8
No files found.
Doc/library/profile.rst
View file @
cebe80b5
...
...
@@ -272,6 +272,9 @@ functions:
pr.print_stats()
.. versionchanged:: 3.8
Added context manager support.
.. method:: enable()
Start collecting profiling data.
...
...
Doc/whatsnew/3.8.rst
View file @
cebe80b5
...
...
@@ -151,6 +151,8 @@ Changes in the Python API
``type.__new__``. A :exc:`DeprecationWarning` was emitted in Python
3.6--3.7. (Contributed by Serhiy Storchaka in :issue:`23722`.)
* The :class:`cProfile.Profile` class can now be used as a context
manager. (Contributed by Scott Sanderson in :issue:`29235`.)
CPython bytecode changes
------------------------
...
...
Misc/NEWS.d/next/Library/2018-05-14-15-01-55.bpo-29235.47Fzwt.rst
View file @
cebe80b5
The :class:`cProfile.Profile` class can now be used as a context manager.
You can profile a block of code by running::
import cProfile
with cProfile.Profile() as profiler:
# ... code to be profiled ...
Patch by Scott Sanderson.
The :class:`cProfile.Profile` class can now be used as a context manager. Patch
by Scott Sanderson.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment