PEP 394 - Clarification of what "python" command should invoke
Hi, as Fedora is getting closer to having python3 as a default, I'm being more and more asked by Fedora users/contributors what'll "/usr/bin/python" invoke when we achieve this (Fedora 22 hopefully). So I was rereading PEP 394 and I think I need a small clarification regarding two points in the PEP: - "for the time being, all distributions should ensure that python refers to the same target as python2." - "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3." The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed) - /usr/bin/python will point to python3 if python2 is not installed, else it will point to python2 (inconsistent; also the user doesn't know he's running and what libraries he'll be able to import - the system can have different sets of python2-* and python3-* extension modules installed) - there will be no /usr/bin/python (goes against PEP and seems just wrong) I'd really appreciate upstream guidance and perhaps a PEP clarification for distributions that ship both python2 and python3, but can live without python2 (and are not Arch :)). Thanks a lot! -- Regards, Slavek Kabrda
On Sep 19, 2014, at 3:31 AM, Bohuslav Kabrda <bkabrda@redhat.com> wrote:
Hi, as Fedora is getting closer to having python3 as a default, I'm being more and more asked by Fedora users/contributors what'll "/usr/bin/python" invoke when we achieve this (Fedora 22 hopefully). So I was rereading PEP 394 and I think I need a small clarification regarding two points in the PEP: - "for the time being, all distributions should ensure that python refers to the same target as python2." - "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3."
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed) - /usr/bin/python will point to python3 if python2 is not installed, else it will point to python2 (inconsistent; also the user doesn't know he's running and what libraries he'll be able to import - the system can have different sets of python2-* and python3-* extension modules installed) - there will be no /usr/bin/python (goes against PEP and seems just wrong)
I'd really appreciate upstream guidance and perhaps a PEP clarification for distributions that ship both python2 and python3, but can live without python2 (and are not Arch :)).
Thanks a lot!
I don’t know for a fact, but I assume that as long as Python 2.x is installed by default than ``python`` should point to ``python2``. If Python 3.x is the default version and Python 2.x is the “optional” version than I think personally it makes sense to switch eventually. Maybe not immediately to give people time to update though? --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
On Fri, Sep 19, 2014 at 04:44:26AM -0400, Donald Stufft wrote:
On Sep 19, 2014, at 3:31 AM, Bohuslav Kabrda <bkabrda@redhat.com> wrote:
Hi, as Fedora is getting closer to having python3 as a default, I'm being more and more asked by Fedora users/contributors what'll "/usr/bin/python" invoke when we achieve this (Fedora 22 hopefully). So I was rereading PEP 394 and I think I need a small clarification regarding two points in the PEP: - "for the time being, all distributions should ensure that python refers to the same target as python2." - "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3."
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches:
- /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation)
Definitely not that. Arch Linux pointed /usr/bin/python at Python 3 some years ago, and I understand that this has caused no end of trouble for the folks on #python. I haven't seen any sign of this being an issue on the tutor@ or python-list@python.org mailing lists, but the demographics are quite different so that's not surprising.
- /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed)
My understanding is that this is the intention of the PEP, at least until such time as Python 2 is end-of-lifed. My interpretion would be that the second recommendation in the PEP is just confused :-) Perhaps the PEP author could clarify what the intention is.
- /usr/bin/python will point to python3 if python2 is not installed, else it will point to python2 (inconsistent; also the user doesn't know he's running and what libraries he'll be able to import - the system can have different sets of python2-* and python3-* extension modules installed)
Likely to cause all sorts of problems, and I understood that this was not the intention. Perhaps it was added *only* as a "grand-father clause" so that people don't yell at Arch Linux "See, the PEP says you're doing it wrong!".
- there will be no /usr/bin/python (goes against PEP and seems just wrong)
Seems like the least-worst to me. If you think of "python == Python 2.x" (at least for the next few years), then if Python 2.x isn't installed, there should be no /usr/bin/python either.
I don’t know for a fact, but I assume that as long as Python 2.x is installed by default than ``python`` should point to ``python2``. If Python 3.x is the default version and Python 2.x is the “optional” version than I think personally it makes sense to switch eventually. Maybe not immediately to give people time to update though?
Agreed. Once Python 2 is finally end-of-lifed in 2023 or thereabouts, then we can reconsider pointing /usr/bin/python at Python 3 (or 4, whatever is current by then). If Arch Linux jumped the gun by a decade or so, that's their problem :-) -- Steven
On 19 Sep 2014 17:38, "Bohuslav Kabrda" <bkabrda@redhat.com> wrote:
- "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3."
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed)
I think this is what should happen, and the PEP is currently wrong. When writing the PEP, I don't think we accounted properly for the case where the "system Python" has migrated to Python 3, but the "default Python for end user scripts that don't specify otherwise" is still Python 2 (which is the migration strategy both Fedora and Ubuntu are adopting). How does this sound as a possible revised recommendation (keep in mind I haven't checked this against the larger context yet): "The more general python command should only be installed whenever the corresponding version of Python is installed (whether python2 or python3)." Regards, Nick.
----- Original Message -----
On 19 Sep 2014 17:38, "Bohuslav Kabrda" < bkabrda@redhat.com > wrote:
- "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3."
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed)
I think this is what should happen, and the PEP is currently wrong. When writing the PEP, I don't think we accounted properly for the case where the "system Python" has migrated to Python 3, but the "default Python for end user scripts that don't specify otherwise" is still Python 2 (which is the migration strategy both Fedora and Ubuntu are adopting). Thanks, that was my thinking, too.
How does this sound as a possible revised recommendation (keep in mind I haven't checked this against the larger context yet):
"The more general python command should only be installed whenever the corresponding version of Python is installed (whether python2 or python3)." It seems to me that it is a bit unclear what "corresponding" is. Would it make sense to explicitly say that "python" command should be installed whenever the distro-chosen default system Python is installed?
Regards, Nick.
Thanks a lot -- Regards, Slavek Kabrda
There are many python2 only scripts with "#!/usr/bin/python" or "#!/usr/bin/env python" shebang in the world. I think Ubuntu and Fedora's strategy is better for now. On Fri, Sep 19, 2014 at 7:12 PM, Bohuslav Kabrda <bkabrda@redhat.com> wrote:
________________________________
On 19 Sep 2014 17:38, "Bohuslav Kabrda" <bkabrda@redhat.com> wrote:
- "Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3."
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed)
I think this is what should happen, and the PEP is currently wrong. When writing the PEP, I don't think we accounted properly for the case where the "system Python" has migrated to Python 3, but the "default Python for end user scripts that don't specify otherwise" is still Python 2 (which is the migration strategy both Fedora and Ubuntu are adopting).
Thanks, that was my thinking, too.
How does this sound as a possible revised recommendation (keep in mind I haven't checked this against the larger context yet):
"The more general python command should only be installed whenever the corresponding version of Python is installed (whether python2 or python3)."
It seems to me that it is a bit unclear what "corresponding" is. Would it make sense to explicitly say that "python" command should be installed whenever the distro-chosen default system Python is installed?
Regards, Nick.
Thanks a lot
-- Regards, Slavek Kabrda
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com
-- INADA Naoki <songofacandy@gmail.com>
On Sep 19, 2014, at 03:31 AM, Bohuslav Kabrda wrote:
as Fedora is getting closer to having python3 as a default, I'm being more and more asked by Fedora users/contributors what'll "/usr/bin/python" invoke when we achieve this (Fedora 22 hopefully). So I was rereading PEP 394 and I think I need a small clarification regarding two points in the PEP:
As Nick points out, I think that the Fedora and Debian ecosystems are aligned on what we *should* do, even if the PEP text needs updating. The way I look at it is that "/usr/bin/python" is user interface. Distributions are completely free to choose whichever Python they want for system scripts, and it's great to see that Fedora is well on their way to making Python 3 the default for system scripts. Debian is also making good progress, though we likely won't complete the transition until Jessie+1. But none of that matters for /usr/bin/python because system scripts will just shebang /usr/bin/python3 and nobody cares. Users almost certainly don't care as long as the script just keeps working, although if there are plugins, it will indirectly matter for them. Only the maintainers of those system scripts really care what the shebang is. For those system scripts, or other /usr/bin entries, that still require Python 2, I think they should already be shebanged /usr/bin/python2. OTOH, users have /usr/bin on their $PATH and they're just going to type 'python' so for them, it's ui, and it *does* matter. In that case I think /usr/bin/python should always point to /usr/bin/python2 which always points to the default Python 2 version (these days, for modern OS versions, almost always 2.7). I don't care how that "pointing" actually works. TL;DR: use #!/usr/bin/python3 for Python 3 system scripts, #!/usr/bin/python2 for Python 2 system scripts, and leave /usr/bin/python to invoke the default Python 2 version.
The important word in the second point is, I think, *whenever*. Trying to apply these two points to Fedora 22 situation, I can think of several approaches: - /usr/bin/python will always point to python3 (seems to go against the first mentioned PEP recommendation) - /usr/bin/python will always point to python2 (seems to go against the second mentioned PEP recommendation, there is no /usr/bin/python if python2 is not installed) - /usr/bin/python will point to python3 if python2 is not installed, else it will point to python2 (inconsistent; also the user doesn't know he's running and what libraries he'll be able to import - the system can have different sets of python2-* and python3-* extension modules installed) - there will be no /usr/bin/python (goes against PEP and seems just wrong)
I think the second point is right. If /usr/bin/python2 is not installed, neither should there be a /usr/bin/python. The reasoning is aligned with my views above. Python 2 won't go away, so even if it is not installed *by default* (and I hope we get there in both Debian and Ubuntu), it is entirely reasonable to assume it will eventually get installed. Someday a user is going to install a script that is Python 2, and then they'll get /usr/bin/python2 installed for that script's shebang. At that point, they'll *also* get /usr/bin/python which of course points to /usr/bin/python2. If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict. If there's general agreement on that, we can work on improving the PEP's wording to make that policy more clear. Cheers, -Barry
On Sep 19, 2014, at 10:16 AM, Barry Warsaw <barry@python.org> wrote:
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not. If that is the case, then all of the user education, ui, etc around ``python3`` would then need to be again updated to ``python4`` *OR* we’d need a ``python3`` bin which points to ``python4``. If there’s a call to action for at some point moving ``python`` to invoke Python 3.x at some point then hopefully at that point Python 4.x could just be ``python``. All of this assuming of course that 4.0 isn’t a major break like 3.0 and that we do 4.0 instead of 3.10 as has been suggested. --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
On Sep 19, 2014, at 10:23 AM, Donald Stufft wrote:
My biggest problem with ``python3``, is what happens after 3.9.
FWIW, 3.9 by my rough calculation is 7 years away.
I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
If that is the case, then all of the user education, ui, etc around ``python3`` would then need to be again updated to ``python4`` *OR* we’d need a ``python3`` bin which points to ``python4``. If there’s a call to action for at some point moving ``python`` to invoke Python 3.x at some point then hopefully at that point Python 4.x could just be ``python``.
All of this assuming of course that 4.0 isn’t a major break like 3.0 and that we do 4.0 instead of 3.10 as has been suggested.
I seem to recall Guido saying that *if* there's a 4.0, it won't be a major break like Python 3, whatever that says about the numbering scheme after 3.9. Is 7 years enough to eradicate Python 2 the way we did for Python 1? Then maybe Python 4 can reclaim /usr/bin/python. Cheers, -Barry
On Fri, Sep 19, 2014 at 10:41:58AM -0400, Barry Warsaw wrote:
On Sep 19, 2014, at 10:23 AM, Donald Stufft wrote:
My biggest problem with ``python3``, is what happens after 3.9.
FWIW, 3.9 by my rough calculation is 7 years away.
That makes it 2021, one year after Python 2.7 free support ends, but two years before Red Hat commercial support for it ends.
I seem to recall Guido saying that *if* there's a 4.0, it won't be a major break like Python 3, whatever that says about the numbering scheme after 3.9.
Is 7 years enough to eradicate Python 2 the way we did for Python 1? Then maybe Python 4 can reclaim /usr/bin/python.
I expect not quite. Perhaps 10 years though. -- Steven
Donald Stufft <donald@stufft.io>:
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
python3 should be the name of the programming language specification. If CPython-4.0 supports all of the python3 programming language, /usr/bin/python3 should be a symbolic link to CPython-4.0. Or, if I reimplemented python3 with cyphon0.7, python3 could be a link to that. If CPython-4.x dropped support for some python3 features, you would no longer link python3 to it. Now, what would plain "python" be? It would make life easier for a lot of people if it were "python2" for all eternity. By analogy, look at #!/bin/sh, which used to invoke the Bourne shell, later /bin/bash and on modern Debian, /bin/dash. Marko
On Fri, 19 Sep 2014 10:16:20 -0400, Barry Warsaw <barry@python.org> wrote:
The way I look at it is that "/usr/bin/python" is user interface. Distributions are completely free to choose whichever Python they want for system scripts, and it's great to see that Fedora is well on their way to making Python 3 the default for system scripts. Debian is also making good progress, though we likely won't complete the transition until Jessie+1.
Yep, user interface. Therefore I think the distribution should let the user choose :) Most users will chose python2, because that's what other scripts they might download and install will expect. So that should be the default. But I'll choose python3 (and have, on most of my gentoo linux systems, which supports having both quite well, for system installed packages). On the gripping hand, given what Fedora is doing, it is not that hard to change (or create) the symlinks as an end user to point to the python3 programs even if Fedora doesn't support it directly, so I don't see a problem with the proposed strategy.
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
As Donald pointed out, that presents a problem for the future. But since there is no good alternative to putting /usr/bin/python3 in the shebang of scripts that require python3, I don't think there is a solution and we're just going to have to cross that further bridge when we come to it. --David
"python" should always be the same as "python2". On Fri, Sep 19, 2014 at 8:03 AM, Steven D'Aprano <steve@pearwood.info> wrote:
On Fri, Sep 19, 2014 at 10:41:58AM -0400, Barry Warsaw wrote:
On Sep 19, 2014, at 10:23 AM, Donald Stufft wrote:
My biggest problem with ``python3``, is what happens after 3.9.
FWIW, 3.9 by my rough calculation is 7 years away.
That makes it 2021, one year after Python 2.7 free support ends, but two years before Red Hat commercial support for it ends.
I seem to recall Guido saying that *if* there's a 4.0, it won't be a major break like Python 3, whatever that says about the numbering scheme after 3.9.
Is 7 years enough to eradicate Python 2 the way we did for Python 1? Then maybe Python 4 can reclaim /usr/bin/python.
I expect not quite. Perhaps 10 years though.
-- Steven _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (python.org/~guido)
On Sep 19, 2014 8:36 AM, "Antoine Pitrou" <solipsis@pitrou.net> wrote:
On Fri, 19 Sep 2014 08:20:48 -0700 Guido van Rossum <guido@python.org> wrote:
"python" should always be the same as "python2".
"Always" as in "eternally"?
Until I say so. Which will happen in the distant future.
On 20 September 2014 00:23, Donald Stufft <donald@stufft.io> wrote:
On Sep 19, 2014, at 10:16 AM, Barry Warsaw <barry@python.org> wrote:
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
FWIW, I think we actually do this better on Windows these days, where PEP 397 made "py" a switchable entry point. I'd like to bring the same scheme to POSIX systems at some point, but that's a *long* way down the todo list (like, so far down I can't even see it any more). I'd be willing to review proposals, though :) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
Donald Stufft wrote:
My biggest problem with ``python3``, is what happens after 3.9.
Python2 technically includes 1.x versions as well, so it wouldn't be unprecedented for python3 to imply versions beyond 3.x. It would be a bit confusing, though. -- Greg
On Sep 19, 2014, at 8:02 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Donald Stufft wrote:
My biggest problem with ``python3``, is what happens after 3.9.
Python2 technically includes 1.x versions as well, so it wouldn't be unprecedented for python3 to imply versions beyond 3.x. It would be a bit confusing, though.
My problem isn’t that it *includes* it, it’s that either people have to go through the mess to update all of their things to ``python4`` at some point in the future, or Python 3.x will need to eventually mean ``python``. Well that or Python 4.x has a ``python3`` binary. --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
Barry Warsaw wrote:
On Sep 19, 2014, at 08:40 AM, Guido van Rossum wrote:
Until I say so. Which will happen in the distant future.
I'm gonna hid your time machine keys so you didn't find them.
Hiding someone's time machine keys never works. Chances are he's already taken a trip to the future in which you get kidnapped and tortured until you reveal where you hid them, and then nipped over there to take them back. Which means he *might* be able to avoid carrying out the actual torture now, as long as it doesn't create too big a temporal paradox. -- Greg
----- Original Message -----
On 20 September 2014 00:23, Donald Stufft <donald@stufft.io> wrote:
On Sep 19, 2014, at 10:16 AM, Barry Warsaw <barry@python.org> wrote:
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
FWIW, I think we actually do this better on Windows these days, where PEP 397 made "py" a switchable entry point. I'd like to bring the same scheme to POSIX systems at some point, but that's a *long* way down the todo list (like, so far down I can't even see it any more). I'd be willing to review proposals, though :)
We did a similar thing with Ruby in Fedora, it's called Rubypick [1]. Is that a direction worth pursuing? Also, what is actually result of this thread? AFAICS the PEP still hasn't changed. IMO when there's only python3 installed, there should be no /usr/bin/python, which also seems to be aligned with what Guido says. Would it be possible to update the PEP accordingly? Thanks!
Cheers, Nick.
-- Regards, Slavek Kabrda [1] https://github.com/fedora-ruby/rubypick
On 30 September 2014 20:13, Bohuslav Kabrda <bkabrda@redhat.com> wrote:
----- Original Message -----
On 20 September 2014 00:23, Donald Stufft <donald@stufft.io> wrote:
On Sep 19, 2014, at 10:16 AM, Barry Warsaw <barry@python.org> wrote:
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
FWIW, I think we actually do this better on Windows these days, where PEP 397 made "py" a switchable entry point. I'd like to bring the same scheme to POSIX systems at some point, but that's a *long* way down the todo list (like, so far down I can't even see it any more). I'd be willing to review proposals, though :)
We did a similar thing with Ruby in Fedora, it's called Rubypick [1]. Is that a direction worth pursuing?
Yes, I think so. The general idea would be to take the PEP 397 launcher CLI and propose a similar API for *nix systems: https://docs.python.org/3/using/windows.html#python-launcher-for-windows
Also, what is actually result of this thread? AFAICS the PEP still hasn't changed. IMO when there's only python3 installed, there should be no /usr/bin/python, which also seems to be aligned with what Guido says. Would it be possible to update the PEP accordingly?
Thanks for the prompt. I just pushed an update [1,2] to merge the previously incorrect bullet point with the one following it, so it now reads: * The more general ``python`` command should be installed whenever any version of Python 2 is installed and should invoke the same version of Python as the ``python2`` command (however, note that some distributions have already chosen to have ``python`` implement the ``python3`` command; see the `Rationale`_ and `Migration Notes`_ below). I also pushed a few tweaks to account for the extension of Python 2.7 maintenance, and to change the verb tense to reflect the fact this was implemented ages ago [3]. Cheers, Nick. [1] https://hg.python.org/peps/rev/3d16b0cd10bc [2] https://hg.python.org/peps/rev/32b6619e9259 [3] https://hg.python.org/peps/rev/0418f146b50f -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
----- Original Message -----
On 30 September 2014 20:13, Bohuslav Kabrda <bkabrda@redhat.com> wrote:
----- Original Message -----
On 20 September 2014 00:23, Donald Stufft <donald@stufft.io> wrote:
On Sep 19, 2014, at 10:16 AM, Barry Warsaw <barry@python.org> wrote:
If the user wants to invoke Python 3, it's not hard to type 'python3' and I think that's the message we should be spreading. That already seems pretty ingrained in user habits afaict.
My biggest problem with ``python3``, is what happens after 3.9. I know Guido doesn’t particularly like two digit version numbers and it’s been suggested on this list that instead of 3.10 we’re likely to move directly into 4.0 regardless of if it’s a “big” change or not.
FWIW, I think we actually do this better on Windows these days, where PEP 397 made "py" a switchable entry point. I'd like to bring the same scheme to POSIX systems at some point, but that's a *long* way down the todo list (like, so far down I can't even see it any more). I'd be willing to review proposals, though :)
We did a similar thing with Ruby in Fedora, it's called Rubypick [1]. Is that a direction worth pursuing?
Yes, I think so. The general idea would be to take the PEP 397 launcher CLI and propose a similar API for *nix systems: https://docs.python.org/3/using/windows.html#python-launcher-for-windows
Thanks, I'll try looking into this if I get some free time...
Also, what is actually result of this thread? AFAICS the PEP still hasn't changed. IMO when there's only python3 installed, there should be no /usr/bin/python, which also seems to be aligned with what Guido says. Would it be possible to update the PEP accordingly?
Thanks for the prompt. I just pushed an update [1,2] to merge the previously incorrect bullet point with the one following it, so it now reads:
* The more general ``python`` command should be installed whenever any version of Python 2 is installed and should invoke the same version of Python as the ``python2`` command (however, note that some distributions have already chosen to have ``python`` implement the ``python3`` command; see the `Rationale`_ and `Migration Notes`_ below).
Exactly what I was looking for, thanks a lot!
I also pushed a few tweaks to account for the extension of Python 2.7 maintenance, and to change the verb tense to reflect the fact this was implemented ages ago [3].
Cheers, Nick.
[1] https://hg.python.org/peps/rev/3d16b0cd10bc [2] https://hg.python.org/peps/rev/32b6619e9259 [3] https://hg.python.org/peps/rev/0418f146b50f
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
-- Regards, Slavek Kabrda
participants (11)
-
Antoine Pitrou
-
Barry Warsaw
-
Bohuslav Kabrda
-
Donald Stufft
-
Greg Ewing
-
Guido van Rossum
-
INADA Naoki
-
Marko Rauhamaa
-
Nick Coghlan
-
R. David Murray
-
Steven D'Aprano