In the review of the PR 4478, Antoine Pitrou proposed to add an environment variable to enable the new Python "developer mode" to inherit the developer mode in child Python processes.
I proposed to add PYTHONDEVMODE=1. Nick Coghlan proposed PYTHONXOPTIONS=dev.
While -X is a new "catch all" for new CPython options, Python got new PYTHONxxx environment variables to enable new options:
* -X faulthandler: PYTHONFAULTHANDLER=1
* -X tracemalloc=N: PYTHONTRACEMALLOC=n
* -X importtime: PYTHONPROFILEIMPORTTIME=1 -- note that the names are different in this case, I don't know why
I have a preference for PYTHONDEVMODE=1.
If we start to use PYTHONXOPTIONS, users may want to use PYTHONXOPTIONS=tracemalloc, and then we have to decide which environment variable has the preference :-(
Moreover, tracemalloc takes an argument, whereas environment variables with a value containing '=' are rare and so likely to cause issues in programs not carefully written to handle such variables. (Environment variables are inherited by all processes, not only Python processes.) |