Re: [Linux-SIG] Revisit of PEP 394 -- The "python" Command on Unix-Like Systems
Nick Coghlan wrote:
= Approach 3: add a magic script comment to opt-in to trying Py3 =
This whole problem just doesn't feel like a per-script setting to me - it feels like a system administrator setting, where they say either "Yes, I am confident in my ability to debug errors arising from myself and others trying to run Python 2 scripts on Python 3", or "I want to preserve compatibility with older Py2 only systems for now, even if that means running parallel Python stacks on my newer systems".
I think it *is* a per-script setting. Remember that we're trying to fix the problem of what /usr/bin/python means to 1) third party scripts that the platform has no control over; 2) the CLI UX. Now, a system administrator managing a suite of shebanged third party scripts for their organization should be able to change the mux'd default. As much as I hate introducing a configuration file, I think that's going to be appropriate here. That would allow: * A system admin to select the system-wide default Python version, assuming the platform provides the option of different versions; * Individual scripts can make their own selection, overriding the system defaults; * Individual users can override the script selection by setting an environment variable. * A user at the command line could also provide a switch to make the selection. Cheers, -Barry
participants (2)
-
Barry Warsaw
-
Nick Coghlan