Python 2.6 to 2.5 cheat sheet

I wrote my code to install Python 2.6.5, but now I need to run it in a cluster that has only 2.5.4, which was not on the horizon when I wrote the code. Hiding the code before 2.5 should not be too difficult, but I was wondering if there was a cheat sheet or an automatic tool that would help me with this. For some things, such as the with statement, the right __future__ import will do the trick, but not for some other things.

+4
source share
2 answers

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

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

+8
source

Have you tried pyqver ? It will tell you what minimum version of Python is required for your code.

I hope this helps

+4
source

All Articles