[Python-Dev] PEP 553: Built-in debug()
fabiofz at gmail.com
Wed Sep 6 13:14:47 EDT 2017
I think it's a nice idea.
Related to the name, on the windows c++ there's "DebugBreak":
which I think is a better name (so, it'd be debug_break for Python -- I
think it's better than plain breakpoint(), and wouldn't clash as debug()).
For the PyDev.Debugger (https://github.com/fabioz/PyDev.Debugger), which is
the one used by PyDev & PyCharm, I think it would also work.
For instance, for adding the debugger in PyDev, there's a template
completion that'll add the debugger to the PYTHONPATH and start the remote
debugger (same as pdb.set_trace()):
i.e.: the 'pydevd' template expands to something as:
I think I could change the hook on a custom sitecustomize (there's already
one in place in PyDev) so that the debug_break() would actually read some
env var to do that work (and provide some utility for users to pre-setup it
when not launching from inside the IDE).
Still, there may be other settings that the user needs to pass to
settrace() when doing a remote debug session -- i.e.: things such as the
host, port to connect, etc -- see:
maybe the debug_break() method should accept keyword arguments to pass
along to support other backends?
On Wed, Sep 6, 2017 at 1:44 PM, Barry Warsaw <barry at python.org> wrote:
> On Sep 6, 2017, at 07:46, Guido van Rossum <guido at python.org> wrote:
> > IIRC they indeed insinuate debug() into the builtins. My suggestion is
> also breakpoint().
> breakpoint() it is then! I’ll rename the sys hooks too, but keep the
> naming scheme of the existing sys hooks.
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev