[Python-Dev] PEP 553, v3

Barry Warsaw barry at python.org
Tue Sep 19 20:45:43 EDT 2017


Barry Warsaw wrote:
> Here’s an update to PEP 553, which makes $PYTHONBREAKPOINT a first class feature.  I’ve also updated PR #3355 with the implementation to match.

I've been in contact with Elizaveta Shashkova from JetBrains.  She gave
a great talk at Pycon 2017 which influenced my thinking about the
feature that lead to PEP 553.

https://www.youtube.com/watch?v=NdObDUbLjdg

She wasn't able to post a follow up directly, but here is her response,
pasted here with her permission.

"In the beginning of 2017 we implemented frame evaluation debugger in
the PyCharm IDE - the debugger, based on the frame evaluation API
(included to Python 3.6 in PEP 523). This implementation improved
debugger's performance significantly.
The main idea of this debugger is using custom frame evaluation function
for implementing breakpoints instead of standard tracing function. In
fact, before the entering a new frame we're modifying the code object,
generated for this frame and we're inserting breakpoints right into the
code object. At the moment we're doing quite complicated things: we
define our own local `breakpoint()` function (which leads debugger to a
suspend state), create a wrapper for it, and insert the wrapper's code
into the user's code. In order to be able to call this function, we add
it to frame's globals dict. It's a bit tricky and it still has some
problems.

So if PEP 553 is accepted, it will help us to make this part of the
debugger much simpler: we will be able to specify our breakpoint
function for the whole program and call built-in breakpoint() function
instead of all these manipulations with wrappers and frame's globals. It
will make our frame evaluation debugger less complicated and more stable."

Cheers,
-Barry



More information about the Python-Dev mailing list