[Python-Dev] breakpoint() and $PYTHONBREAKPOINT (original) (raw)

Nathaniel Smith njs at pobox.com
Mon Sep 11 21:15:06 EDT 2017


On Mon, Sep 11, 2017 at 5:27 PM, Barry Warsaw <barry at python.org> wrote:

On Sep 10, 2017, at 13:46, Nathaniel Smith <njs at pobox.com> wrote:

On Sun, Sep 10, 2017 at 12:06 PM, Barry Warsaw <barry at python.org> wrote: For PEP 553, I think it’s a good idea to support the environment variable $PYTHONBREAKPOINT[*] but I’m stuck on a design question, so I’d like to get some feedback.

Should $PYTHONBREAKPOINT be consulted in breakpoint() or in sys.breakpointhook()? Wouldn't the usual pattern be to check $PYTHONBREAKPOINT once at startup, and if it's set use it to initialize sys.breakpointhook()? Compare to, say, $PYTHONPATH. Perhaps, but what would be the visible effects of that? I.e. what would that buy you?

Why is this case special enough to break the rules?

Compared to checking it on each call to sys.breakpointhook(), I guess the two user-visible differences in behavior would be:

-n

-- Nathaniel J. Smith -- https://vorpus.org



More information about the Python-Dev mailing list