I tried searching but I couldn’t find any way to ask for, or use, a debug Python build. This is useful as it runs with asserts enabled, and is very helpful for finding bugs in C extension modules.
I tried just calling
python-dbg, but is not found in any of the Python 3 versions, and instead falls back to the default command-not-found behaviour (“run apt-get install python-dbg”). However, this is wrong, as Python is installed manually by travis scripts (e.g. “Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/16.04/x86_64/python-3.8.tar.bz2”), and does not match the apt-provided package.