Live data from Hacker News

Python 3.0 Released

python.org

21–30 of 63 posts

Re: Python 3.0 Released

#21
post #17

So much cleaner and more consistent. Classic classes are gone for good! Unlike with other languages (which I won't name for fear of offense!) I think Pythonistas will actually migrate to this much improved Python (well, forgetting the 10% performance hit) especially as such focus has been put into making tools to make it easier, unlike with PHP 4->5 (oops..!)

Any elaboration on where the 10% performance hit comes from? I read over the "What's New" and Guido's announcement, but I didn't find any mention of it.

Under "Performance" at http://docs.python.org/dev/3.0/whatsnew/3.0.html :

The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. There’s room for improvement, but it will happen after 3.0 is released!

Re: Python 3.0 Released

#22
post #19
post #17

Earlier quoted context omitted.

Any elaboration on where the 10% performance hit comes from? I read over the "What's New" and Guido's announcement, but I didn't find any mention of it.

Most likely the biggest cause is the removal of special-casing for small integers. http://docs.python.org/dev/3.0/whatsnew/3.0.html#performance I'm anticipating a more thorough discussion of this on python-list or python-dev in the near future.

I expect it's just a case of removing optimizations in order to get everything stable, then they can start work on new optimizations. I'm not a Python dev though, so elaboration would be cool ;-)

Re: Python 3.0 Released

#23
The download link for Python 3.0 is now featured prominently on the front page, above Python 2.6. I think this is a bad move, since many Python newbies will probably download Python 3.0 instead of 2.6, and then get frustrated when none of their 3rd-party packages work. python.org should keep Python 3.0 more hidden away for the time being to give time for the greater Python development community to migrate to 3.0.

Re: Python 3.0 Released

#24

The download link for Python 3.0 is now featured prominently on the front page, above Python 2.6. I think this is a bad move, since many Python newbies will probably download Python 3.0 instead of 2.6, and then get frustrated when none of their 3rd-party packages work. python.org should keep Python 3.0 more hidden away for the time being to give time for the greater Python development community to migrate to 3.0.

A base python installation is good enough for most of the tasks for a newbie. Python 3.0 is out in a quite stable form for early migration testing, it's not as bad as you describe.

Re: Python 3.0 Released

#25
post #15
post #5

Remember python 3.0 is supposed to be an intermediate for migration release... not for production use. That's what 3.1 is for. It's going to take ages for modules to get converted over... but most projects have been preparing for it for a while. However hopefully the migration scripts will get better over the 3.0 - 3.1 timeline. For now I'm sticking with python 2.5 - since it's the best one considering it's far bette…

Initially I was excited about 3.0 but as you pointed out it will take some time for modules to get converted over. I think this is very important. For me, one of the big selling points of Python is the large number of libraries written for it. With my luck I will need to use an obscure library that won't be updated any time soon by the author. So I'll have to stick with 2.5 or 2.6 because I need to get my job done ra…

Python 3.0 includes a script that tries to automatically convert 2.6 code to 3.0 code, named 2to3. It's also incorporated into the package setup library, so in theory simply installing a Python 2.6 package with 3.0 will automatically convert the source code.

Of course, that means making your code work with 2to3 to begin with, but that's a much lower barrier to adoption than outright porting and dual maintenance.

Re: Python 3.0 Released

#26
post #20

I loved it, but I still want better threading and multi-core support in CPython... Most desktops now have two cores and it doesn't seem likely that number will fall anytime soon...

Python 2.6 and 3.0 ship with a new library called multiprocessing which provides mechanisms for process control and intercommunication, which conveniently sidesteps the GIL limitation that prevents multiple core usage.

The library is loosely based around the existing threading API, and allows for seamless transfer of Python objects between processes (unlike other forms of IPC).

Re: Python 3.0 Released

#27
post #19

Earlier quoted context omitted.

Most likely the biggest cause is the removal of special-casing for small integers. http://docs.python.org/dev/3.0/whatsnew/3.0.html#performance I'm anticipating a more thorough discussion of this on python-list or python-dev in the near future.

I expect it's just a case of removing optimizations in order to get everything stable, then they can start work on new optimizations. I'm not a Python dev though, so elaboration would be cool ;-)

In this particular case, I think it's because all ints are now longs. Or rather, there's one int type and it behaves like a long.

I'm not a python dev either, but that's what I've gathered by lurking the python-dev and python-3000 mailing lists.

Re: Python 3.0 Released

#28
Wow, even the introduction is incredible.

"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 library has been reorganized in a few prominent places."

I have never seen a release for a new language be so clear and straightforward. That's awesome.

Re: Python 3.0 Released

#29
post #27

Earlier quoted context omitted.

I expect it's just a case of removing optimizations in order to get everything stable, then they can start work on new optimizations. I'm not a Python dev though, so elaboration would be cool ;-)

In this particular case, I think it's because all ints are now longs. Or rather, there's one int type and it behaves like a long. I'm not a python dev either, but that's what I've gathered by lurking the python-dev and python-3000 mailing lists.

Just to clarify for non-Pythonistas, a "long" is an unlimited precision integer.

Re: Python 3.0 Released

#30

Guess it's a good time to learn Python!

I agree that it's a good time to learn Python... because it's always a good time to learn Python.

However, be aware that no one in the Python community expects 3.x to be used widely for a few years. Even for new projects, if you want to depend on an existing 3rd party library that hasn't yet been ported, you'll probably have to stick with 2.6.

To accommodate this, they allow you to import almost all of the 3.0 features in 2.6 on a file-by-file basis. So you can pretty much write code in Python 2.6 as if it was 3.0 provided you do the necessary "from __future__ import XXX" at the top of your file to do things like make "print" a function rather than a language keyword, etc. You won't have the reorganized standard library, but for most tasks there's either no difference or minor differences.

So yes, definitely learn Python, but be sure to install both 2.6 and 3.0. I recommend learning with 3.0, but you may have to do "real" projects in 2.6 for some time.

Post reply on HN