3 ms·
There were a few breaking changes, like renaming things, and they dropped the "print" statement. It is possible to write code for both 2 and 3, but you have to
by captainmuon 13y ago
There were a few breaking changes, like renaming things, and they dropped the "print" statement. It is possible to write code for both 2 and 3, but you have to jump through a few hoops, and can't use the nice features of Python 3.
The official way to do it was to write in Python 2, and then use a converter to generate the Python 3 code (which was backwards IMHO). If the Python maintainers encouraged writing code that worked on both versions, they could have done a lot to help so (like providing compatibility modules, or backports).
But more important than new libraries that work with both versions (or even with just Python 3) is all the legacy code that doesn't run without heavy modifications on Python 3. If they had refrained from needless breaking changes (like removing the `print` statement), and made the braking improvements opt-out (like renaming str->bytes and unicode->str), it would be much easier to transition to the newer versions.