Python source is generally compatible (go another level deeper and you'll find that the
.py files are mostly symlinks to a single copy, at least on Debian-type systems).
However, the compiled
.pyc files need to be regenerated for each version, which explains the separate directories. The symlinks are a messy hack, resulting from the fact that Python requires the
.pyc files to go in the same directory as the corresponding
.py files, even though you need multiple
.pyc files for each
.py file. If Python could cache the
.pyc files somewhere else, the mess could go away.
The main problem with Python compatibility is with the C ABI, which varies across different packages, making it impractical to use Python to add scripting to a C program, for example:
http://www.mail-archive.com/python-3000@python.org/msg09051.html