![]() | Ned Batchelder : Blog | Code | Text | Site What's in which Python? » Home : Blog : September 2011 |
What's in which Python?Friday 30 September 2011 I'm teaching a class next week, and in their work environment, the students are limited to using Python 2.4. I wanted to be clear about what features of Python they'd have available, and which they wouldn't. The "What's New in Python" docs are very comprehensive, but spread out across many pages and full of distracting details. So I made this list of the high points, what's in each version of Python 2.x. Items with a star were introduced with a __future__ import. 2.1: April 2001
2.2: December 2001
2.3: July 2003
2.4: December 2004
2.5: August 2006
2.6: October 2008
2.7: July 2010
tagged:
python» 12 reactions | |
Comments
Awesome! It's fascinating to research this sort of stuff and see the progression of the language. I am working on something similar for just import-related stuff (though with more detail, delved from the depths of the repo).
Nice idea, Ned. Just last week I was bitten by something not in 2.5 in code I wanted to be portable back that far and I thought I'd read the "what's new in 2.x" docs pretty careful (not to mention having lived through all these releases as a professional developer). Yet my oversight item is in your list. Can see myself checking back with this list now and again for sanity.
Very nice work.
Thanks for the summary. Great.
However, there is more python than python 2.x . Why did you choose to check only 2.x changes?. If they are young students, in the next future, they are going to be dealing with the 3 series rather than with python 2.
I have just the thing for you, http://comparethepython.com lists builtins, types, keywords, exceptions, modules, command line switches, environment variables and features by version from 2.2 to 3.2.
The site is new, you may find the characters I chose don't render on Windows. However the code is at https://github.com/moreati/pythoncompare and the source data is at http://docs.google.com/spreadsheet/ccc?key=0At5kubLl6ri7dHU2OEJFWkJ1SE16NUNvaGg2UFBxMUE&hl=en_US
@joaquin: I stuck to 2.x for a few reasons: First, the course I'm teaching is 2.x, sp my immediate need was to know what features in the course they wouldn't be able to make use of. If the course mentions a 3.x addition, it's clearly labelled as such. Similarly, the entire Python community is still focused on the 2/3 split, so new 3.x features are generally clearly marked. But when people recommend the "with" statement, they rarely mention that it appeared in 2.5, because there's a general assumption that 2.x people are on a recent 2.x.
Maybe in the future I'll make add in the 3.x stuff.
@Alex, comparethepython is very nice. You are right about the characters not appearing in my Windows Firefox browser. Perhaps an image sprite instead? Yours is another good source for detailed information about each release, which complements my 10,000-foot view nicely. Glad to see all the different slicing of the information.
@Alex, a couple of suggestions: add a key/legend/tooltip and contact info. Nice site though :)
@Ned, why stick with Python 2.4?
@Christian: it isn't my choice. The students work in an environment limited to 2.4, I don't know why.
@Christian, I think I still wasn't clear. What I mean is, in their day jobs, outside of class, their work environment is limited to 2.4. The students are all with the same employer.
You may be interested in https://github.com/ghewgill/pyqver which attempts to identify the minimum version of Python required to run a given script. It uses the `compiler` module to parse the source and then inspects the resulting syntax tree. There is a version of the script for Python 2 and one for Python 3.
Boolean datetype should be Boolean datatype.
@limodou, thanks, I fixed it.
Add a comment: