Hello,
After reading some benchmarks, I noticed that python 3.1 is slower than python 2.6, especially with I/Os.
So I wonder what could be the good reasons to switch to Python 3.x ?
Hello,
After reading some benchmarks, I noticed that python 3.1 is slower than python 2.6, especially with I/Os.
So I wonder what could be the good reasons to switch to Python 3.x ?
Largely because of the new I/O library. This, however, has been completely rewritten to C in Python 3.2 and 2.7. I think the performance numbers are pretty close right now if you compare it to 3.2.
edit: I confused the version numbers. Nevermind.
Go to 3.1. Unless your code is run-once (which at almost never is). 2.6 has no future, and version 3 is the future, unless you are into time travel.
They are working on 3.1 and I can assure you the speeds will soon be up to par, and then exceed 2.6 speeds.
Python 3 does introduce some new language features too. One of my favorite is the new nonlocal
keyword, which finally lets you write certain closures nicely, such as:
def getter_setter(): x = 0 def getter(): return x def setter(val): nonlocal x x = val return (getter, setter)