I liked how Canonical did it: the command `python` would not execute, you have to use `python3` explicitly. This means that your old Python 2 code would not get executed if it were triggered by some shell script via the `python` command, you'd have to fix the shell script and become aware that you still need to migrate the Python script.
This is also how Debian did it, too. Actually it's probably propagated from Debian Unstable to Ubuntu.
You need to install either "python-is-python2" or "python-is-python3" packages to get proper system-wide symlinks. Also, it was strictly verboten to give either of two packages as dependencies to workaround migration procedures.
Debian Testing doesn't have Python2 at least for a year now.
I've upgraded debian thru the ages and /usr/bin/python defaulted to python2. Didn't need to install anything for that to happen, maybe if you installed debian from scratch
Another mistake in Py3 migration was keeping the interpreter name as python so when you had it in path you had a choice of new stuff breaking or old stuff breaking
> I've upgraded debian thru the ages and /usr/bin/python defaulted to python2
It was, in the past.
When python2.7 deprecated and removed in Debian testing, python ceased to exist as a command. You need to install these packages (python-is-python{2,3}) to get the python command and point to the correct interpreter you like.
This behavior is consistent in two Debian testing systems, installed 6 and 9 years ago, respectively.
> Another mistake in Py3 migration was keeping the interpreter name as python...
I installed python-as-python3 myself, after python2 disappeared from system to fix an oddball python3 script which bundled as a part of a bigger software package which is not in official repositories.
Maybe they have fixed it, but I didn't bother to check till now. I'm not even sure which program it was.
So, it was an addition to a clean system and didn't inadvertently directed python2 code to python3 interpreter.