Python 3.3.0 Released 131
An anonymous reader writes "After just over a month of release candidates, the final version of Python 3.3 launched today. This version includes new syntax, including the yield from expression for generator delegation; new library modules, including fault handler (for debugging crashes), ipaddress, and lzma (for data compression using the XZ/LZMA algorithm); a reworked OS and I/O exception hierarchy; the venv module for programmatic access to Python virtual environments; and a host of API changes. The full list of features and the change log are both available."
Re:Python 3 and its use (Score:3, Informative)
I think Ubuntu is going Python 3. Most of the scientific stuff has been ported (though the Matplotlib port may be immature).
Bottle, Pyramid, and Tornado are all ported. Just not Django.
It's probably now at the point where new projects are better off starting with Python 3, to ease the pain of upgrading later, unless there's a library they really need. Starting with a mature (but depreciated) platform is not a great idea.
Re:Python 3 and its use (Score:5, Informative)
Re:Python 3 and its use (Score:5, Informative)
Killing Python 2 is going to be like killing IE6 and Windows XP - a noble goal that turns out to take decades. And it's a totally self-inflicted wound by the Python community.
Except nobody intends to kill Python 2 anytime soon. When Python 3 was shaped, it was everyones plan to have Python 2 + 3 alongside for a long time.
Re:Python 3 and its use (Score:5, Informative)
#!/bin/env python
might give you python2 or python3. And there's no standardized way to ask for python2 or python3.
Re:Python 3 and its use (Score:5, Informative)
Pretty clear and standardised to me.
Re:Python 3 and its use (Score:3, Informative)
Re:Because .py3 wasn't used (Score:2, Informative)
The launcher is added with 3.3 and suppose you can install it separately too.
http://docs.python.org/dev/using/windows.html#launcher
Tried and had no problems with python2.7 and python3.3 installed
Re:Because .py3 wasn't used (Score:4, Informative)
One reason why Python 3 hasn't taken off is that it didn't adopt .py3 as a file name suffix for Python 3 programs.
A lot of the Python programs I've written don't have any extension on the file name. They're intended to be commands in the system. The language they're written in is an unimportant implementation detail (and might change one day). There's usually no need to make the implementation language user-visible.
Re:Undisclosed new feature (Score:3, Informative)
In case anyone is wondering, many programs should perform better under Python 3.3 than under 3.2, due to the new way of storing Unicode strings [python.org]:
The memory usage of Python 3.3 is two to three times smaller than Python 3.2, and a little bit better than Python 2.7, on a Django benchmark.
Benchmarks that focus on certain types of string-operations have seen slowdowns, but real-world applications (such as Django web applications) should benefit from this change. (And real-world applications that perform intensive and performance critical string manipulations should use PyPy.)
One other new feature (Score:5, Informative)
It's a part of PEP 380, which is mostly about "yield from", but this little gem actually matters elsewhere. You can now return values from iterators. I.e.:
Since return from an iterator just raises StopIteration exception, they've added a field to propagate the value. Previously you could only use the no-argument return.
Why this matters is because it gives you the final bit needed to provide full syntactic sugar to write asynchronous functions (task-based, chained callback model - think Node.js, or Twisted in Python land) as if they were synchronous, except that you use "yield" at the points where you want to cooperatively yield control. Of course yield is the bigger part of it anyway, and it was there before, but you had to use some magic function call to implement final return. Now it really looks exactly like a synchronous function, except for "yield".