Paul Moore added the comment:

I agree, I don't particularly want versioned executables. I'm not sure I see 
much point to even having versioned launchers - "py -2" and "py -3" seem fine 
to me if needed.

The only use cases I can see are:

1. Use the Python executable that's first on PATH: "py"
2. Use the specific system installation of Python X[.Y]: "py -X[.Y]"

For shebang usage:

1. Use the Python executable that's first on PATH: "#!/usr/bin/env python"
2. Use the specific system installation of Python X[.Y]: 
"#!/usr/bin/pythonX[.Y]"
3. Use a specific interpreter: "#!<absolute path>"

The Unix ability to have 2 different versions of Python on PATH and select 
which you use based on executable name doesn't exist on Windows, and so there's 
no equivalent of the Unix "#!/usr/bin/env pythonX[.Y]"

If you want your script to fail under certain conditions - whether it's that 
the interpreter is a version you don't support, or something else, then test 
for that case and fail with an error. Checking runtime conditions doesn't need 
to be handled by the shebang.

The only change I'd consider reasonable here would be a doc change to explain 
the behaviour a bit more clearly. I might try to put something together if I 
have the time.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28686>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to