-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-32043: Rephrase -X dev documentation #4478
Conversation
Doc/using/cmdline.rst
Outdated
when an isuse is detected. In short, ``python3 -X dev ...`` behaves as | ||
``PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python3 -W default -X faulthandler ...``, | ||
except that the :envvar:`PYTHONMALLOC` and :envvar:`PYTHONASYNCIODEBUG` | ||
environment variables are not set in practice. Effect of the developer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of which, perhaps it would be nice to set those environment variables so that child processes launched using subprocess
inherit them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps let people set them themselves if they want to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a deliberate choice to not inherit the "developer mode" to child processes. If someone would like an inherited mode, I would prefer to add a new PYTHONDEVMODE=1 environment variable, since it's more natural to inherit environment modes.
It's the same for -W ignore vs PYTHONWARNINGS=ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that PYTHONDEVMODE=1 is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps PYTHONXOPTIONS=dev
? That way it would more directly parallel the -W
vs PYTHONWARNINGS
arrangement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor suggestions inline, but generally looks good to me.
The PYTHONXOPTIONS
/PYTHONDEVMODE
question should be split out to a separate tracker issue.
Doc/using/cmdline.rst
Outdated
and :envvar:`PYTHONASYNCIODEBUG` environment variables are not set in | ||
practice. Developer mode: | ||
* ``-X dev``: enable the "developer mode", enable runtime debug checks which | ||
are too expensive to be enabled by default. It should not be more verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable CPython's "developer mode", introducing additional runtime checks which are ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Doc/using/cmdline.rst
Outdated
* ``-X dev``: enable the "developer mode", enable runtime debug checks which | ||
are too expensive to be enabled by default. It should not be more verbose | ||
than the default if the code is correct: new warnings are only emitted | ||
when an isuse is detected. In short, ``python3 -X dev ...`` behaves as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: isuse -> issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
* should not be more verbose if the code is correct * enabled checks can be "expensive"
I created bpo-32101: Add PYTHONDEVMODE=1 to enable the developer mode. |
https://bugs.python.org/issue32043