The latest tag points to a digest in the repository. Other tags may also happen to point to that same digest, but there's no requirement for this, it's entirely up to the repository owner. You could query every tag to find the ones pointing to the same digest, but at present, that can be a lot of API calls.
Specifically for python, and at the time of this answer, the repository owner has specified the following under the shared tags section of the documentation:
- 3.13.1, 3.13, 3, latest:
- 3.13.1-bookworm
- 3.13.1-windowsservercore-ltsc2022
- 3.13.1-windowsservercore-1809
In the case of the nested tags there, the bookworm and windowsservercore images do not have the same digest, but they contain platform specific images that are the same as those in the latest image. You can inspect the contents of the image with commands like:
docker buildx imagetools inspect python:latest