Nick Heiner
Nick Heiner

Reputation: 122490

Versions of Python

I need to write Python compliant with 2.5.1. I currently have Python 3.1 on my machine. If I make a PyDev project and set the grammar to "2.5", will the code I write be compatible (both syntactically and semantically)? Or must I go download an older version of Python?

Upvotes: 0

Views: 122

Answers (3)

Lennart Regebro
Lennart Regebro

Reputation: 172269

PyDev's grammar setting only changes the syntax highlighting. To know if your code works you must run it with Python 2.5, so yes you must download it.

Upvotes: 3

Senthil Kumaran
Senthil Kumaran

Reputation: 56881

I think it is a bad idea to set the grammar to 2.5 from 3.1. Just download the older python 2.5 version and use the compiler and the libraries with it. Between major versions changes happen to the API signatures and new features get added. You cannot afford to develop in high version in pydev and compile for another without encountering problem. Moreover Python 3.1 is backwards incompatible with Python 2.x (print is a function for e.g), so it is better you download and use Python 2.5 if that is the requirement.

Upvotes: 1

Tim Pietzcker
Tim Pietzcker

Reputation: 336208

Python 3 is not backwards-compatible with Python 2, so you do need to download and install Python 2.5 if you want to write compatible code.

Upvotes: 3

Related Questions