As I am sure most of you have heard Python 3.0 (final) has been released. For me, this means some nights getting some continuing development projects updated for the language changes and freezing some projects in maintence mode with their own copy of Python 2.6 (or in some cases 2.4).
Some highlights
- print is now a function: print(“5×5″, “is”, 5*5, sep=” “)
- annotations for methods (I create a lot of libraries, so this is great!)
- extended unpacking: x, y , *z = [1,2,3,4,5] now x is 1, y is 2, and z is 3-5
- <> removed, use != (personal favorite cause I hate <>)
- no longer can you from import * inside functions
See the whole list here: http://docs.python.org/3.0/whatsnew/3.0.html
manuelg says:
I believe the extended unpacking syntax is:
a, b, *rest = some_sequence
04 Dec 2008, 22:39Wayne says:
Yep, was typo. Correct. Thanks.
05 Dec 2008, 20:16patrick says:
Extended unpacking was something I always think python has, but then get confused when I realize it doesn’t work. I keep forgetting you can’t do that currently. Finally py3k has caught up to my brain!
06 Dec 2008, 02:11