Compatibility of python2.5 with pytohn2.3

Gabriel Genellina gagsl-py2 at
Fri Jul 20 16:38:00 CEST 2007

En Wed, 18 Jul 2007 08:36:24 -0300, Gerhard Häring <gh at>  

>> Hi all,
>>  I am new member of this post. I have a C application which uses
>> Python(version 2.3) extensively with SWIG wrappers. I want to upgrade
>> the Python to latest version2.5.
>> Is there any compatibility issue between two versions? Does latest
>> Python2.5 provide backward compatibility to previous Python (Version
>> 2.3 in my case) constructs.

> Short answer: yes.
> I've never had any issues here (compiling Python extension code in newer
> Python versions). The other way around that's of course not the case. I
> have to test my extension code against Python 2.4 and Python 2.3  
> regularly,

I would add this single point as the most relevant change in 2.5: "The  
obmalloc changes mean that you must be careful to not mix usage of the  
PyMem_*() and PyObject_*() families of functions. Memory allocated with  
one family's *_Malloc() must be freed with the corresponding family's  
*_Free() function." (On previous versions, mixing calls from different  
families could go mostly unnoticed, as nothing bad would happen).
Regarding Python source files, their encoding declaration is now mandatory  
when they contains any non ascii string.
(Reviewing the "What's new" documents would be a good idea anyway)

Gabriel Genellina

More information about the Python-list mailing list