<div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,0)">Hi Barry,</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">I think it's a nice idea.</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">Related to the name, on the windows c++ there's "DebugBreak":  <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679297(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms679297(v=vs.85).aspx</a>, 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()).</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">For the PyDev.Debugger (<a href="https://github.com/fabioz/PyDev.Debugger">https://github.com/fabioz/PyDev.Debugger</a>), which is the one used by PyDev & PyCharm, I think it would also work.</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">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()):</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">i.e.: the 'pydevd' template expands to something as:</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)"><div class="gmail_default">import sys;sys.path.append(r'path/to/ide/shipped_debugger/pysrc')</div><div class="gmail_default">import pydevd;pydevd.settrace()</div><div><br></div><div>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).</div><div><br></div><div>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: <a href="https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd.py#L1121">https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd.py#L1121</a>, so, maybe the debug_break() method should accept keyword arguments to pass along to support other backends?</div><div><br></div><div>Cheers,</div><div><br></div><div>Fabio</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 6, 2017 at 1:44 PM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sep 6, 2017, at 07:46, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
><br>
> IIRC they indeed insinuate debug() into the builtins. My suggestion is also breakpoint().<br>
<br>
</span>breakpoint() it is then!  I’ll rename the sys hooks too, but keep the naming scheme of the existing sys hooks.<br>
<br>
Cheers,<br>
-Barry<br>
<br>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/fabiofz%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>fabiofz%40gmail.com</a><br>
<br></blockquote></div><br></div>