bytecode non-backcompatibility

Fuzzyman fuzzyman at gmail.com
Mon Apr 25 04:34:25 EDT 2005


Maurice LING wrote:
> Hi,
>
> I've been using Python for about 2 years now, for my honours project
and
> now my postgrad project. I must say that I am loving it more and more

> now. From my knowledge, Python bytecodes are not back-compatible. I
must
> say that my technical background isn't strong enough but is there any

> good reason for not being back-compatible in bytecodes?
>

It *shouldn't* be a problem for pure python modules. The interpreter
will recognise that the bytecode has the wrong 'magic number' and
recompile.

Seeing as a new major version of python will probably be installed in a
new directory at the very least you will have to copy the modules
across. If they have install files (or a setup.py) wouldn't it be
better to use that *anyway* ?

> My problem is not about pure python modules or libraries but the
problem
> is with 3rd party libraries with C bindings (not python pure). It
means
> that with every upgrade of python, I have to reinstall all my 3rd
party
> libraries which can be quite a bit of work...
>

It is a nuisance. It's more of a nuisance when third part modules with
'c' components are compiled for the new version of python (a windows
specific problem).

I did find that the last upgrade forced me to evaluate which extensions
I actually used. The answer was 'a few less than I thought'. It became
a good opportunity to spring clean my 'site-packages' folder.

Best Regards,

Fuzzy
http://www.voidspace.org.uk/python

> I do hope this problem will be sorted out some day.
> 
> Cheers
> Maurice




More information about the Python-list mailing list