Friday 30 September 2011 — This is 13 years old. Be careful.
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.
Update: I’ve now collected all the “What’s in which Python”s onto a single page: What’s in which Python.
BTW: there’s also What’s in which Python 3.0–3.3? and What’s in which Python 3.4–3.6?.
2.1: April 17th, 2001
- Nested scopes *
- “from __future__”
- Rich comparisons
- Weak references
2.2: December 21st, 2001
- New-style classes
- Iterators
- Generators *
- // integer division
- Dividing ints can produce floats *
2.3: July 29th, 2003
- Set datatype module
- Boolean datatype
- Importing from zip files
- enumerate
- The logging and csv packages
- Extended list slicing
2.4: November 30th, 2004
- Native set datatype
- Generator expressions
- Function decorators
- string.Template
- reversed()
- The subprocess and decimal modules
2.5: September 19th, 2006
- The “with” statement *
- Conditional expressions
- The functools module
- Unified try/except/finally
- Value passed into generators
- defaultdict
- any(), all(), min(key=) and max(key=)
2.6: October 1st, 2008
- The multiprocessing package
- str.format()
- 3.0 compatibility: print function *, byte literals, io library
- “except” with “as” keyword
- Abstract base classes
- Class decorators
- The fractions module
2.7: July 3rd, 2010
- Set literals syntax
- Dictionary and set comprehensions
- OrderedDict and Counter classes
- argparse
- .format can use bare {} placeholders
Comments
Very nice work.
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.
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
Maybe in the future I'll make add in the 3.x stuff.
@Ned, why stick with Python 2.4?
Add a comment: