With Python 2.5 having come out last October and Python 2.6 not yet out of beta, one could wonder why the Python developers are releasing information about Python 3000 now, a full year before its expected release. The reason is simple: it's the end of the (Python) world as we know it. Python 3000 (aka, Python 3.0) is going to break backwards compatability in several ways with the entire 2.x series and will leave 1.x as ancient history. The most important breaks posted thus far include:
All of these features/issues come with Python 3.0 but not before. Consequently, there is as yet no way for you to buffer your code against incompatabilities by starting to write in 3.0 style now. Expect to review and rewrite as needed. Expect also to have two groups of Python programmers for a few years after the advent of 3.0. Many development groups will probably stay with the 2.x series for the compatability, upgrading to 3.0 only when necessary.
- The print statement has been changed to a print function. Instead of
print "Hello, World!"
You will need to write:print('Hello, World!')
- Python 3 uses strings and bytes instead of Unicode strings and 8-bit strings. This is a solution to the 2.x bugs which arise from encoding issues.
- File I/O will require an encoding. The wrong encoding will likely result in an I/O error.
- Bytes are not hashable and will lose some functions like
lower,strip, andsplit. For these one should use the string methods. - map() and filter() return iterators.
dictmethods return views instead of lists.- Simple division returns a float (e.g., '1/2'). Doubling the division symbol gets the truncated version (e.g., '1//2').
- Code that unconditionally strips the trailing
Lfrom therepr()of a long integer will chop off the last digit instead.
All of these features/issues come with Python 3.0 but not before. Consequently, there is as yet no way for you to buffer your code against incompatabilities by starting to write in 3.0 style now. Expect to review and rewrite as needed. Expect also to have two groups of Python programmers for a few years after the advent of 3.0. Many development groups will probably stay with the 2.x series for the compatability, upgrading to 3.0 only when necessary.
Comments
Comments are closed for this post.
