@@ -39,7 +39,7 @@ enter the debugger. However this idiom has several disadvantages.
39
39
debugging options, say if you're using an IDE or some other development
40
40
environment.
41
41
42
- * Python linters (e.g. flake8 [1 ]_) complain about this line because it
42
+ * Python linters (e.g. flake8 [linters ]_) complain about this line because it
43
43
contains two statements. Breaking the idiom up into two lines further
44
44
complicates the use of the debugger,
45
45
@@ -50,7 +50,7 @@ other languages, and utilizing a convention that already exists in Python.
50
50
Proposal
51
51
========
52
52
53
- The JavaScript language provides a ``debugger `` statement [2 ]_ which enters
53
+ The JavaScript language provides a ``debugger `` statement [java ]_ which enters
54
54
the debugger at the point where the statement appears.
55
55
56
56
This PEP proposes a new built-in function called ``breakpoint() ``
@@ -70,7 +70,7 @@ and it can be set to a different function to change the debugger that
70
70
default value of ``sys.breakpointhook() `` to make it easy to reset.
71
71
This exactly models the existing ``sys.displayhook() `` /
72
72
``sys.__displayhook__ `` and ``sys.excepthook() `` /
73
- ``sys.__excepthook__ `` hooks [ 3 ]_.
73
+ ``sys.__excepthook__ `` [ hooks ]_.
74
74
75
75
The signature of the built-in is ``breakpoint(*args, **kws) ``. The positional
76
76
and keyword arguments are passed straight through to ``sys.breakpointhook() ``
@@ -100,7 +100,7 @@ can have various values:
100
100
value may be a string with no dots, in which case it names a built-in
101
101
callable, e.g. ``PYTHONBREAKPOINT=int ``. (Guido has expressed the
102
102
preference for normal Python dotted-paths, not setuptools-style entry point
103
- syntax [4 ]_ .)
103
+ syntax [syntax ]_ .)
104
104
105
105
This environment variable allows external processes to control how breakpoints
106
106
are handled. Some uses cases include:
@@ -147,7 +147,7 @@ Evaluation of $PYTHONBREAKPOINT
147
147
There has been some mailing list discussion around this topic. The basic
148
148
behavior as described above does not appear to be controversial. Guido has
149
149
expressed a preference for ``$PYTHONBREAKPOINT `` consultation happening in
150
- the default implementation of ``sys.breakpointhook ``.
150
+ the default implementation of ``sys.breakpointhook `` [ envar ]_ .
151
151
152
152
The one point of discussion relates to whether the value of
153
153
``$PYTHONBREAKPOINT `` should be loaded on interpreter start, and whether its
@@ -157,11 +157,11 @@ It is the PEP author's opinion that the environment variable need only be
157
157
looked up at the time of use. It is also the author's opinion that the value
158
158
of the environment variable can be accessed each time ``sys.breakpointhook ``
159
159
is run, to allow for maximum functional flexibility. Because this feature
160
- enters the debugger, any performance improvements for caching is negligible
161
- and does not outweigh the flexibility. Further, because the special case of
162
- ``PYTHONBREAKPOINT=0 `` is fast-tracked, the no-op code path is quite fast, and
163
- should be in the noise given the function calls of ``breakpoint() `` ->
164
- ``sys.breakpointhook() ``.
160
+ enters the debugger, any performance improvements for caching will be
161
+ negligible and do not outweigh the flexibility. Further, because the special
162
+ case of ``PYTHONBREAKPOINT=0 `` is fast-tracked, the no-op code path is quite
163
+ fast, and should be in the noise given the function calls of ``breakpoint() ``
164
+ -> ``sys.breakpointhook() ``.
165
165
166
166
167
167
Breakpoint bytecode
@@ -191,7 +191,7 @@ it as handy as ``breakpoint.pm()``.
191
191
Implementation
192
192
==============
193
193
194
- A pull request exists with the proposed implementation [5 ]_.
194
+ A pull request exists with the proposed implementation [impl ]_.
195
195
196
196
197
197
Rejected alternatives
@@ -243,15 +243,23 @@ Version History
243
243
References
244
244
==========
245
245
246
- .. [1 ] http://flake8.readthedocs.io/en/latest/
246
+ .. [linters ]
247
+ http://flake8.readthedocs.io/en/latest/
247
248
248
- .. [2 ] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
249
+ .. [java ]
250
+ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
249
251
250
- .. [3 ] https://docs.python.org/3/library/sys.html#sys.displayhook
252
+ .. [hooks ]
253
+ https://docs.python.org/3/library/sys.html#sys.displayhook
251
254
252
- .. [4 ] http://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=console#automatic-script-creation
255
+ .. [syntax ]
256
+ http://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=console#automatic-script-creation
253
257
254
- .. [5 ] https://github.com/python/cpython/pull/3355
258
+ .. [impl ]
259
+ https://github.com/python/cpython/pull/3355
260
+
261
+ .. [envar ]
262
+ https://mail.python.org/pipermail/python-dev/2017-September/149447.html
255
263
256
264
257
265
Copyright
0 commit comments