There are many new modules (including brand new XML support through the xml package, and i18n support through the gettext module); a list of all new modules is included below. Lots of bugs have been fixed.
The process for making major new changes to the language has changed since Python 1.6. Enhancements must now be documented by a Python Enhancement Proposal (PEP) before they can be accepted.
There are several important syntax enhancements, described in more detail below:
Augmented assignment, e.g. x += 1
List comprehensions, e.g. [x**2 for x in range(10)]
Extended import statement, e.g. import Module as Name
Extended print statement, e.g. print >> file, "Hello"
Other important changes:
Optional collection of cyclical garbage
So quite a few important new features, but nothing that was breaking backwards compatibility.
List comprehension is the feature that, to me, defines Python. It's simple, powerful, versatile, intuitive, and broadly applicable. A wonderful replacement for loops and iteration. I've been using set comprehension and dictionary comprehension, too.
Buttery smooth. I “ported” 8000 lines of Python code from 1.5.2 to 2.6 years ago. It took a day or so and that’s only because I insisted on refactoring in Python 2.6 niceties and leaning on the standard library more.
Transitioning from 1 to 2 was like going down a nice water slide
Transitioning from 2 to 3 was like going down a piping hot stainless steal slide in the middle of summer and then getting hit in the face with a brick at the end.
333
u/[deleted] Sep 16 '20
What was the transition from 1 to 2 like?