Hypermodern Python Tooling
Ch1
Python versioning
- Python has an annual release cycle: feature releases happen every October
- Each feature release gets a new minor version in Python’s
major.minor.microscheme. - Feature versions are maintained for five years, after which they reach end-of-life
- prereleases fall into three consecutive phases: alphas, betas, and release candidates
a1, b3, rc2

Locating Python Interpreters
When you type python3 at the command line:
the shell searches the directories in the PATH environment variable from left to right and invokes the first executable file named python3

You can modify the path with:
export PATH="$PATH:/usr/local/opt/python/bin"
# Raise in priority
export PATH="/usr/local/opt/python/bin:$PATH"Python on Windows
PATH is less relevant in windows because Python installs can be located via Windows Registery.
Windows has a python launcher py that manages selection of python versions for you, it is the entry point to all installed python version.
py # select most recent vervsion
# unless in virtual env then select virtual env
py -3.11 # forward to 3.11 interpreter
py --list # list versionsPython on Mac
Note
I skipped this…
Python on Linux
Typically installed through the Linux distro (apt, dnf).
TODO: Pyenv etc…
Python Entry Point for Unix
Note
Just download the binary. I did this it seems to work well and fast. I think this may be the way to go.
https://github.com/brettcannon/python-launcher.git
The creator is a cypthon maintaner, so you can use this if you’d like to select python interprerters, same as on windows with py instead of invoking the interpreter directly.
Its key benefit unified, cross-platform way to launch Python, with a well-defined default when no version is specified: the newest interpreter on the system.
You can run many third-party tools by passing their import name to the -m interpreter option. Suppose you have installed pytest (a test framework) on multiple Python versions. Using py -m pytest lets you determine which interpreter should run the tool. By contrast, a bare pytest uses the command that happens to appear first on your PATH.
If you invoke py with a Python script but don’t specify a version, py inspects the first line of the script for a shebang—a line specifying the interpreter for the script. Stick with the canonical form here: #!/usr/bin/env python3. Entry-point scripts are a more sustainable way to link a script to a specific interpreter, because package installers can generate the correct interpreter path during installation