A bit more discussion on $PYTHONBREAKPOINTHOOK
This commit is contained in:
parent
4c66411b5c
commit
4d937a7453
16
pep-0553.rst
16
pep-0553.rst
|
@ -90,6 +90,7 @@ We want to get confirmation from at least one alternative debugger
|
|||
implementation (e.g. PyCharm) that the hooks provided in this PEP will
|
||||
be useful to them.
|
||||
|
||||
|
||||
Breakpoint bytecode
|
||||
-------------------
|
||||
|
||||
|
@ -102,6 +103,7 @@ bytecode streams to trampoline into their own debugger. Having a
|
|||
in order to invoke this trampoline. *NOTE*: It probably makes sense to split
|
||||
this idea into a separate PEP.
|
||||
|
||||
|
||||
Environment variable
|
||||
--------------------
|
||||
|
||||
|
@ -114,6 +116,20 @@ This would provide execution environments such as IDEs which run Python code
|
|||
inside them, to set an internal breakpoint hook before any Python code
|
||||
executes.
|
||||
|
||||
If we did add that hook, what should be the default value and should
|
||||
it be easy to disable ``breakpoint()``? The rationale here is calls
|
||||
to ``breakpoint()`` that might accidentally sneak into production.
|
||||
|
||||
The author's opinion is that if we support this environment variable
|
||||
it should be enabled --and point to ``pdb.set_trace()``-- by default.
|
||||
This way it Just Works for the average developer. The maintainers of
|
||||
CI, build, or production systems should be able to easily configure
|
||||
their environments to disable ``breakpoint()``. We probably want to
|
||||
support a shorthand for "disable built-in breakpoint()", e.g.::
|
||||
|
||||
$ export PYTHONBREAKPOINTHOOK=0
|
||||
|
||||
|
||||
Call a fancier object by default
|
||||
--------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue