News for hackers. Stuff that matters.
Re:Python 3.11 by blondin on Sunday October 03, 2021 @10:20PM (#28742334)
i sympathize.

the problem is apple. they are (understandably) refusing to ship an up-to-date global python interpreter with macOS. not only that, they aren't removing the default 2.7 that they ship.

macOS Big Sur ships Python 2.7. ha. ha. ha.

none of the proposed "virtual environments" solutions are going to rescue you when you operate globally at the OS-level and not in a sandbox.

been there.

Re:Python 3.11 by oefrha on Monday October 04, 2021 @01:56AM (#28743514)
1. macOS ships a /usr/bin/python3 that is up-to-date at the time of the feature freeze of a major macOS release, e.g. macOS 11 ships Python 3.8.2 from February 2020.

2. /usr/bin/python being a symlink for python2.7 is entirely consistent with PEP 394 recommendations, especially the version before June 2019: https://raw.githubusercontent.com/python/peps/214736457f6d61...

  * Unix-like software distributions (including systems like Mac OS X and
    Cygwin) should install the ``python2`` command into the default path
    whenever a version of the Python 2 interpreter is installed, and the same
    for ``python3`` and the Python 3 interpreter.
  * When  invoked, ``python2`` should run some version of the Python 2
    interpreter, and ``python3`` should run some version of the Python 3
    interpreter.
  * If the ``python`` command is installed, it 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).
The 2019 update https://github.com/python/peps/commit/ae932bd6fd2c493d7d64ce... allowed more flexibility, but the old handling is still entirely okay.
Re:Python 3.11 by JimDabell on Sunday October 03, 2021 @11:44PM (#28742843)
> not only that, they aren't removing the default 2.7 that they ship.

Yes they are:

    $ python

    WARNING: Python 2.7 is not recommended. 
    This version is included in macOS for compatibility with legacy software. 
    Future versions of macOS will not include Python 2.7. 
    Instead, it is recommended that you transition to using 'python3' from within Terminal.
    
    Python 2.7.16 (default, Aug 30 2021, 14:43:11) 
    [GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
Re:Python 3.11 by wutbrodo on Sunday October 03, 2021 @11:12PM (#28742606)
> they are (understandably) refusing to ship an up-to-date global python interpreter with macOS

What is the understandable reasoning?

Re:Python 3.11 by mbreese on Monday October 04, 2021 @12:14AM (#28742982)
It's pretty common to have kept `/usr/bin/python` as Python2. This is the most conservative option and won't break anything that's already running. Anyone who is using Python currently will have already installed Python 3 (or knows how to do this), and is probably using `#!/usr/bin/env python3`. As an OS vendor with many (many...) systems in the wild, you don't want to switch Python versions on people unexpectedly. Especially when it's still pretty painless to keep python2 around even if there is an installed python3.

For anyone that's still using python2 (as a nearby comment mentioned), there is now at least a warning to avoid using the default Python 2.7 (/usr/bin/python). For an OS vendor, this transition takes a long time... but at least it's in process.

Re:Python 3.11 by wutbrodo on Tuesday October 05, 2021 @09:20AM (#28759022)
Oh, sure, it's definitely not a good idea to change what the unqualified python binary refers to. But I interpreted "refusing to ship an up-to-date global python interpreter with macOS" as meaning that Python3 isn't shipped at all, with the binary name "python3").

Is that the case? If so, I still don't understand the reasoning.

Re:Python 3.11 by mbreese on Tuesday October 05, 2021 @11:45AM (#28761033)
I don’t think anything in macOS (the base OS) requires Python, does it? If not, then, I don’t see why Apple would want to ship any Python with the OS. Let people install the Python version they want and then the users will have to maintain it.
Re:Python 3.11 by wutbrodo on Tuesday October 05, 2021 @06:38PM (#28766633)
The comment I asked rhe question of said:

> the problem is apple. they are (understandably) refusing to ship an up-to-date global python interpreter with macOS

Ie the claim is that it's causing a problem for users. I don't have an opinion about this point, but it is the premise of my question.