[Python-Dev] PEP 553; the interaction between $PYTHONBREAKPOINT and -E

Victor Stinner victor.stinner at gmail.com
Thu Oct 5 07:33:58 EDT 2017

> What if make the default value depending on the debug level? In debug mode
> it is "pdb.set_trace", in optimized mode it is "0". Then in production
> environments you can use -E -O for ignoring environment settings and disable
> breakpoints.

I don't know what is the best option, but I dislike adding two
options, PYTHONBREAKPOINT and -X nobreakpoint, for the same features.
I would become complicated to know which option has the priority.

I would prefer a generic "release mode" option. In the past, I
proposed the opposite: a "developer mode":


"python3 -X dev" would be an "alias" to "PYTHONMALLOC=debug python3.6
-Wd -bb -X faulthandler script.py".

Python has more and more options to enable debug checks at runtime,
it's hard to be aware of all of them. My intent is to run tests in
"developer mode": if tests pass, you are sure that they will pass in
the regular mode since the developer mode only enables more checks at
runtime, it shouldn't change the behaviour.

It seems like the consensus is more to run Python in "release mode" by
default, since it was decided to hide DeprecationWarning by default. I
understood that the default mode targets end users.


More information about the Python-Dev mailing list