Porting from Python 2.3 to 2.4

A

Anand

Hi

Are there any tools that would help in porting code from
Pyton 2.3 to 2.4 ? I have gone through the whatsnew documents
and created a document comparing Python 2.4 to 2.3. But so far
has not been able to find any tool that will signal code in
Python 2.3 that can cause errors in Python 2.4 .

rgds

-Anand
 
J

Joseph Garvin

Anand said:
Hi

Are there any tools that would help in porting code from
Pyton 2.3 to 2.4 ? I have gone through the whatsnew documents
and created a document comparing Python 2.4 to 2.3. But so far
has not been able to find any tool that will signal code in
Python 2.3 that can cause errors in Python 2.4 .

rgds

-Anand
All 2.x versions are backwards compatible. Porting just means taking
advantage of new features. Unless you've been naughty and are accessing
private methods in stdlib, you're probably fine.
 
R

Rocco Moretti

Joseph said:
All 2.x versions are backwards compatible. Porting just means taking
advantage of new features. Unless you've been naughty and are accessing
private methods in stdlib, you're probably fine.

Not strictly speaking true - if your program is taking advantage of some
of the dark corners of the language, there is a chance your program
might not work. Be aware though, that programs that take advantage of
"features" which change between 2.x releases likely aren't using best
practices anyway. (The Python team strongly hesitates to change behavior
if it breaks backward compatibility for a large number of programs.)

See http://www.python.org/doc/2.4.1/whatsnew/whatsnew24.html for details
on what changes.

Possible non-backward compatible changes for 2.3->2.4 transition:

*Int/long operations no longer produces FutureWarnings that can be
suppressed. (Uses new behavior instead.)
*Integer operations will no longer trigger an OverflowWarning.
*You can't rebind None.
*New modules/builtin functions added - if you've used the same names,
you may get the wrong module/function in corner cases.

Minor issues all, but if you happen to rely on that behavior, your code
will now fail, sometimes silently.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,991
Messages
2,570,217
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top