Question about Python
Daniel Dittmar
daniel.dittmar at sap.corp
Fri Jul 1 10:10:56 EDT 2005
Jan Danielsson wrote:
> But then it occured to me.. I started writing my program in Java
> pre-1.5. Then came 1.5, I upgraded, and my program would still compile
> and run, though I did get three warnings. The language had changed a
> little bit; I had to assign a type to three arrays. That wasn't so bad.
>
> However, when I look at the various Python modules/libraries, I see
> that there are several versions of them, for different versions of
> python. I've seen everything from "for python 1.5" up to "for python
> 2.4" with all versions in between. This scares me a little bit. I assume
> that the reason for the different versions is because of new language
> features?
Python is generally backwards compatible
* pure Python modules will work unchanged when used with a newer version
of Python (so it's almost always: for Python 1.5 and later). You might
get some deprecation warnings and these appear one every run (compared
to Java, where they appear only when compiling). But they can be disabled.
* Python extension modules written in C can mostly be recompiled from
source with the new headers and will work as well
* binary extensions generally won't work with newer Python, that's why
you often see several downloads for a specific module. On Unix, binary
compatibility worked pretty well up to 2.2 (Meaning I could use modules
compiled for 1.5 with Python 2.2), but that was just a coincidence and I
wouldn't rely on it for future versions.
Summary: If you are able to compile all your needed extensions yourself,
then new Python versions aren't really a problem.
Daniel
More information about the Python-list
mailing list