Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 2.6 to 2.5 cheat sheet

I've written my code to target Python 2.6.5, but I now need to run it on a cluster that only has 2.5.4, something that wasn't on the horizon when I wrote the code. Backporting the code to 2.5 shouldn't be too hard, but I was wondering if there was either a cheat-sheet or an automated tool that would help me with this. For some things, like the with statement, the right __future__ imports will do the trick, but not for some other things.

like image 372
Chinmay Kanchi Avatar asked Dec 16 '22 21:12

Chinmay Kanchi


2 Answers

Have you read the What's New in Python 2.6 document? It describes the 2.5->2.6 direction, but you should be able to figure out the reverse from it.

As far as I know, there are no automated tools for 2.6 to 2.5. The only tool I know of is the 2to3 app for going to Python 3.

like image 52
Mike DeSimone Avatar answered Jan 03 '23 15:01

Mike DeSimone


Have you tried pyqver? It will tell you which is the minimum version of Python required by your code

I hope it helps

like image 37
luc Avatar answered Jan 03 '23 16:01

luc