When I press tab
on the command python3.7
I get the following
python3.7 python3.7-config python3.7m python3.7m-config
I looked up what's python3.7m
and found the answer - https://stackoverflow.com/a/16677339/6849682.
Next I go to the python terminal of each implementation and type the following code
>>> import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
I get the same output in both python implementations i.e .cpython-37m-darwin.so
I also tried the command diff <(python3.7 -m sysconfig) <(python3.7m -m sysconfig)
to see if there's any difference in configuration info of the 2 executables but the output is empty means they are the same.
If all the executables and configuration variables are same, then why create two different implementations of python?
Note:
I'm not talking about python3.7/3.7m-config
here.
python3.7
andpython3.7m
are the same program, just with two different names. These two files are hard-linked, meaning they point to the same file on disk (i.e., they have the same inode).Here is the line in the cpython 3.7
Makefile
that performs this hardlink.$(LDVERSION)
would be3.7m
, and$(VERSION)
would be3.7
. This is the only place in the Makefile that performs a hardlink.The python3.7 Docker image is used below to demonstrate that
python3.7
andpython3.7
have the same inode.