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: (Score:2)
PS. I'm not a Python fan, I actually dislike it.
Re: (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.)
Re: (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, Funny)
Bottle, Pyramid, and Tornado are all ported. Just not Django.
Ah, I remember when you stood a decent chance of guessing what something did from its name. And all this was cherry orchards, far as the eye could see.
Re: (Score:1)
Mercedes-Benz SLK, Dodge Viper, Apple iPod, McDonald's, Intel Pentium, Linux, BSD, American Telephone & Telegraph System 5, Netscape Navigator, Sun Solaris, Sun Java, C, ...
Re: (Score:3, Interesting)
Re:Python 3 and its use (Score:5, Funny)
Gimp is a program for cripples?
Ok, that one is self explanatory.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
It is!
It should be obvious even by looking at the box [flickr.com].
Re: (Score:2)
All those cherries ended up in the CherryPy.
Re: (Score:2)
You mean like awk and bison I presume?
Unix having arbitrarily odd names for programs and commands is not new.
Re: (Score:2)
When starting a new project, please select a name that isn't already in common use. It's so much easier to google.
Re: (Score:1)
Python 2.7 is not going anywhere in Ubuntu. If you want to continue to use it, please do!
The movement toward Python 3 in Ubuntu will be mostly transparent to users. Users generally don't care what language their desktop applications are written in, so the fact that some will now be in Python 3 instead of Python 2 should have no effect on them, except perhaps the *lack* of dreaded UnicodeErrors in non-English locales, since we can now take advantage of Python 3's clear distinction between bytes and strings
Re:Python 3 and its use (Score:5, Insightful)
"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."
Unless you want to use Python on Google App Engine, where Python 2.7 is what you get. And given that Guido himself works for Google on this project, that's not exactly encouraging.
Or unless you want a Python app to work out of the box on, well, just about anything, but OSX is the example that bit me.
I remember discussing Python 3 on /. when it came out. The decision not to even try to ensure backwards compatibility struck me as disastrous. The response was "No, because Python will never have a cruft problem because we are not Perl coders", or something like that. Many years on, I still think it was disastrous. Python now has a bigger legacy code problem than Perl - seen much Perl 4 recently? - precisely because the upgrade path is such a pain.
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.
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: (Score:2)
Well, semms like we need to standardize that. Virtualenv makes it less of a problem, but does not solve it. Also, you can make code that run on both versions. It is harder, but you can.
Python3 is way better than Python2, and everybody seems to agree on that. Every big project out there either supports or is adding support for it, so killing Python2 may be much easier than IE6.
Re: (Score:3)
Re:Python 3 and its use (Score:5, Informative)
Pretty clear and standardised to me.
Re: (Score:2)
Don't say always. At some point Python2 will be deprecated. Possibly not for 5 years or more, but at some point. It has been announced that python2.7 will be the last release of the Python2 series. Well, they may change their minds, and go to python2.8, but that's not the current plan.
So Python2 is stable, and will endure for quite awhile. But not forever. If you're planning for the next decade, you should use Python3. Don't plan for longer. C might be stable in that long a run, but don't count on i
Re: (Score:2)
<command name='run' path='myprog.py'>
<runner interface='http://repo.roscidus.com/python/python'>
<version not-before='2.6' before='3'/>
</runner>
</command>
will select Python 2.6 or 2.7 on Debian, Ubuntu, Fedora, OpenSUSE, Arch, Windows, MacOS X,
(example taken from the docs at http://
Re: (Score:2)
Re: (Score:1)
Python 3 is not really a different language than Python 2. Yes, there are some backward incompatibilities, but I think their impact on Python programmers has been way overblown. Through experience, most of us doing primarily Python 3 work know that it is usually rather easy to write code that works in both Python 2 and Python 3. If the code has a very clear model of what are byte and what are strings (the hardest part about porting, which Python 2 let you be sloppy about), then it is generally very easy
Re: (Score:2)
Agreed. Science stuff works great (including matplotlib)
Re: (Score:3)
Arch Linux (obviously) is using Python 3 by default for a long time. On the scientific side, numpy/scipy and all that stuff are ported, but a lot of other scientific modules still aren't, which sucks.
Re:Python 3 and its use (Score:5, Informative)
Re: (Score:2)
Is anything major using Python 3 already?
Guess it depends on your measurement. Blender [blender.org] uses (hosts) Python 3 for scripting.
Re: (Score:3)
For some reason I can't get "yum install python" to work.
Re: (Score:3)
Re: (Score:2)
Re: (Score:1)
"Google hasn't used Python for anything in years" is a bit of a stretch, but it's no secret that Google really only uses Python for their legacy apps these days.
Re: (Score:2)
If that's the case, then why do they employ Guido (and pay him for, essentially, just working on Python)?
Re: (Score:2)
Re: (Score:2)
He does have a point. I love Red Hat and derivatives, I program daily in Python, but you can call yum anything but speedy.
Re: (Score:2)
Re: (Score:2)
Well, I remember yum hitting 1 GB allocated memory on RedHat 5 when updating. The lead developer told me that he couldn't do anything about that, it was just the size of the repository.
Yum is not bad, but far from a Python poster child.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Took me a while, but brilliant!
Re: (Score:2)
That's totally unfair. At least with Pascal you can see all the code.
Re: (Score:2)
Re: (Score:2)
By "real world" you mean custom enterprise programming? Sorry, Python is only good if you evrybody on the team is competent, so the PHBs won't ever like it. Thus, no, most jobs will stay at Java/.Net.
Now, for the people that are out of that segment - like, you know, the people that CREATE most things out there - it is a real alternative that must be weighted against the others. The thing is, if you create something, that thing didn'
Re: (Score:2)
Re: (Score:3, Informative)
Wait! (Score:1)
It's no Perl6 (Score:1)
I'm waiting for that
Python 2.7.3 is the new IE6 (Score:2, Insightful)
From python3 release notes (dated December 3rd, 2008):
'''Python 3.0 (a.k.a. "Python 3000" or "Py3k") is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard
Re: (Score:2)
Re: (Score:1)
I tend to agree. Most *libraries* that are still actively maintained either already support Python 3, have Python 3 ports in the works, or have contributed patches to support Python 3. Most abandoned projects will probably never get ported, but that's just life in the FLOSS lane. Newer, better, more compatible alternatives will become available. Most new projects usually include Python 2 and Python 3 support right from the start. It's not difficult.
Of course, the higher up the food chain you go, the fe
Because .py3 wasn't used (Score:2, Insightful)
PS2 was already taken. Twice. (Score:2)
Atleast better than .ps1-files (powershell scripts) which is named ".ps1" for all released versions, 1.0, 2.0 and 3.0.
Sony might have objected had PowerShell scripts been named with the interpreter version in the manner that you appear to imply. PS2, for example, was taken twice: one by an IBM PC model that introduced the keyboard and mouse connector used for years before USB, and once by a game console.
Re: (Score:2)
However, did you consider that .ps was already used for postscript files
I'm aware of PostScript files. But was .psh associated with any well-known application?
Re: (Score:3)
Re: (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
Launcher (Score:2)
The launcher [python.org] is added with 3.3
Thank you. Side-by-side on Windows was broken in 3.0, 3.1, and 3.2, but now that it appears fixed, one more obstacle to adoption of Python 3.3 is out of the way.
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.
Hide extensions for known file types (Score:3)
There's usually no need to make the implementation language user-visible.
I agree in some cases, such as on a Linux or *BSD server where shebangs or rewriting or type-maps or MultiViews can safely keep the implementation language out of the URL space. But on the Windows desktop, Microsoft tried this with "Hide extensions for known file types", and it led to all sorts of trojans where the user didn't realize that what the user thought was a document was actually an executable.
Re: (Score:2)
What's wrong with .sh for your Python programs? Or no extension at all?
Interpreters in Unix are specified in the file, not by file nomenclature. All my Python2 software starts with:
#!/usr/bin/env python2
If I want to know what a program is, I of course use: /usr/local/bin/program
file
program: a python2 script text executable
Windows is what's wrong (Score:2)
What's wrong with .sh for your Python programs?
The fact that I'd have to replace Windows Explorer on end users' Windows PCs with a UNIX style shell. This was a problem until Python 3.3, which associates .py files with a limited shebang interpreter as AC mentioned [slashdot.org].
Re: (Score:1)
Ignoring inconvienient facts, aren't we?
1) Java is open source and it does maintains syntax compatibility. However, incompatibilities between platform versions are so huge that it's unlikely for a program written for Java 5 to run unmodified on Java 6 (this happens in Python too, obviously, but to a lesser degree and it won't happen in version 2 of the language).
2) C++ and D are essentialy non-compatible dialects of C. You are free to treat Python and Py3k as two different languages if you feel better that
Re: (Score:1)
Python 2.7.3 is the new IE6
Except that IE 6 is an abomination to all mankind, while python 2.7.3 is not.
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
What mistakes are you referring to? What was so broken in Python 2 that required a completely incompatible Python 3 as a fix?
Changes in Python 3 [python.org]
The first three don't have too much of an impact to anyone who does not writ
Re: (Score:2)
Re: (Score:2)
Major releases aren't API compatible. That's been the mantra for everyone who releases software for a very long time.
I suppose Linux should've changed names instead of going to 2.6 from 2.4? Or perhaps to 3.x?
Re: (Score:2)
Re: (Score:2)
In the VFX community, you pretty much stray from 2.6 at your peril, and certainly 3.x is a no-fly option if you want to stay 'current' with the latest apps. It's incredibly frustrating, since the previous 'standard', if you could call it that, was TCL, and python is better on so many levels...but this has tainted it mightily.
Re: (Score:2)
How very hipster of you.
But, you're simply wrong. If you had bothered to do even the slightest bit of reading [python.org], you'd know full well that the Python creators never intended for Python 3 to replace 2 overnight. The break in compatibility was done deliberately, and with a great deal of thought. There are a number of things fundamentally wrong with Python 2 that can't be fixed with
Re: (Score:3)
While python2 and python3 might have been intended to be installed alongside, that just didn't work out and created a huge mess. By the time your script would know that it's been loaded with the wrong version of python (as for a script that starts with #!/usr/bin/env python it's not possible to know what it will get), it's too late, because python crashed it for syntax errors.
Python is an interpreted language. There's no reason why compatibility
Snake wranglers: Challenge for You MakeHuman (Score:2)
if any of y'all want to have some fun then take a stab at converting MakeHuman to Python 3.* (please note if you can get it to run contact the Project Managers)
Of course if you want to play with an Open Source version of Poser you can also have fun.
Re: (Score:2)
I don't understand, I suspect you have a LISP.
Weak third-party library support (Score:5, Interesting)
The trouble with Python 3 is that nobody took responsibility for converting the third-party libraries. Many major libraries became abandonware in that transition. Rather than converting the old ones, in some cases, new incompatible libraries were developed. So not only do you have to convert your code from Python 2 to 3 (for which there is a tool to help), you have to change your code to use new libraries. Python doesn't have enough market share that major projects like MySQL and OpenSSL maintain the Python bindings for their project. At one point, the Python binding for OpenSSL was maintained by a World of Warcraft guild.
Perl has CPAN, which actually hosts library source and has some Q/A functions. Python just has PyPi (formerly "Cheese Shop"), which is just a directory of links.
This is Python's real problem. Python's Little Tin God For Life doesn't want the headaches of managing library maintenance. But he's not willing to let go and turn control over to an organization that can manage the grunt work of getting all the parts to work together. That's also why there is no Python ISO standard, and why none of the implementations other than CPython support 3.x.
Re: (Score:3)
Re: (Score:1)
This just isn't how volunteer driven, open source projects work. The core Python development community, along with a vast number of really fantastic contributors, does take responsibility for the core set of libraries in the standard library. The universe of third party Python code is so vast, there's no way any central organization could be responsible for porting it.
I know Python 3 will be an unqualified success because I can see all the amazing project leaders who are porting their code to Python 3, or
Re: (Score:1)
Correct, since the libraries are either-or and 3.whatever was spottily supported the last time around (12 months ago), there are effectively two languages, Python2 (you need for those libraries) and Python3 (you'd rather use). Python's attractiveness diminished so much so that neither of these two languages were chosen.
Re: (Score:3)
This is totally non-sensical. Those libraries would have become abandonware without the transition, as their authors had ceased to maintain them at any rate. It's good that others have written replacements. That's how the open source world functions.
Re: (Score:2)
The trouble with Python 3 is that nobody took responsibility for converting the third-party libraries. Many major libraries became abandonware in that transition.
This is totally non-sensical. Those libraries would have become abandonware without the transition, as their authors had ceased to maintain them at any rate.
I doubt that's what happened in most cases. Seems more likely that the authors are like me: they're in the Python 2.x world, run computers with Python 2.x as the default version, and see no compelling reason to migrate, especially if it would mean maintaining two branches of their library.
Re: (Score:2)
And you're an idiot.
Perl5 and Perl6 are different languages. The equivalent to the python2 to python3 migration in Perl is in the point versions in Perl, and these do occasionally break compatability; yet thanks to the extended testing framework, most major libraries are patched within months, thanks to the magic of CPAN's testing framework.
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".
Open Your Mind (Score:2)
There sure are a lot of posts here declaring what various people think "went wrong" with python 3. I find it pretty funny that each post describes a different perceived problem, yet reveals a similarly self-absorbed view, and in many cases a presumption that the 2-to-3 transition should have been universally complete by now. Folks, consider this: A project might not actually be a failure just because it's different from whatever you're used to.
Re: (Score:2)
Re: (Score:3)
Well, for one thing C is so basic, that there are fewer places that it needs to adapt. Even so, it *REALLY* needs to improve the handling of unicode strings and utf-8 files. This can't be patched by add-on libraries. And for my purposes, garbage collection would be a real benefit. (I mean standard garbage collection. And a decent garbage collection would mean that you couldn't freely inter-convert integers and pointers, or do pointer arithmetic, though properly constrained pointer arithmetic is feasibl
Re: (Score:2)
Whether you can handle your own memory management or not depends on what you are doing. In relatively small applications it's no problem. Start getting larger, and you can't tell which processes are using, or going to use, which pieces of memory. It does, however, place constraints on what lower level operations are allowed. But so does parallel processing in general, even if it's small enough that you CAN manually handle memory allocation.
FWIW, even algorithmic garbage collectors run into problems when