Python 3.0

The 3rd day of this month, a new step towards Python‘s perfectness was taken. Python 3.0 (or 3000 like is most known) was officially released.

Like the good old Python style this version breaks up with many of the stuff used before but this time it is an even deeper break as this is the version that corrects some of Python’s design issues. For example, Python stands for conciseness but before this new version, the print function was not concise with the function’s definition:

print “text”    instead of print(“text”)

Since this might be an issue, a 2to3 converter script is available to minimize eventual headaches when porting your software. On top of this, the performance was improved at about 30% which means Python will continue kicking, for example, Ruby’s ass in what comes to speed.

See what’s new in this Python’s version.

Let’s hope for a big acceptance of Python among its users and get big projects like Django and PyGTK supporting it!

Update: It seems I got it wrong about the performance improvement… Sorry fellow Pythonistas, my bad! See the comments for an explanation.

6 thoughts on “Python 3.0”

  1. Actually, concision was not a reason for making “print” a function. The function version is actually *less* concise. Often, people would start out with print and then, for one reason or another, move to using Python logging, which uses functions. The 2.x print syntax makes that conversion more difficult than it needs to be.

    Django is looking to support 2.4, and maybe 2.3 for a while longer, and straddling 2.3/4 through 3.x is a bit much. Plans are to gradually migrate over the next year or two.

    Most of the negativity I have seen in the community regarding the Python 3.0 release seems predicated on a perceived (and false) sense of urgency. ( We *must* convert our projects now! We *have to* port our code now! And that sucks!) I think that orderliness far more important than speed in moving from 2.x to 3.x. 2.x will be supported for at least a few years more, and that is how it should be. Python 3.x is all about not having to live with certain small annoyances forever, and not about sweeping changes. The focus should be on scheduling conversions for minimum pain, and not upon getting Python 3.x in use as fast as possible.

  2. Well, python 3k is a big step forward. However not yet in tems of speed. According to what’s new article the python 3 is 10% slower than v2.5 .

    Here is the statement on the official page:
    “Performance
    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!”

  3. http://wiki.python.org/moin/PortingDjangoTo3k

    For Django the issue right now is waiting for the MySQL, Postgresql and Oracle bindings to be ported to 3.0, then the rest can follow. SQLite3 has been shown to work. The effort was simple enough that a branch has not been created as it would be more effort to maintain a port going forward than it would be to do it again later once those libraries are available.

  4. Hi guys,

    Actually I read on a Spanish edition of Linux Magazine that the performance was improved by 30% by I see now that I was wrong… should have searched more… 🙂

    About changing our projects to 3.0, well, I haven’t really had the chance to make a deep use of the 3.0 version but the changes seem nice to me. When I said I hope it gets acceptance by the community was in terms of the changes and have the big projects ported but “when it’s time”. By other means, if the 3.0 gets widely used I hope to see our favorite projects supporting it as well.
    I do not support the *you HAVE TO port your projects* vision. I will surely not port mine any time soon! It all depends on the flow of the community.

    Anyways, I am happy from my first overview of it.

    Thank you guys for your comments and pointing out the mistakes on the performance thing.

  5. “””
    I do not support the *you HAVE TO port your projects* vision.
    “””

    I know you don’t. You just triggered my standard spiel on the matter. Some people seem to be reacting to Python 3.0 as an immediate threat. In a couple of years, 2to3 will have evolved considerably and a larger percentage of contemporary apps will be based on 2.6.x+. There no doubt *will* be some pain. But somewhat less, I think, than what some are apparently expecting.

    I’m looking forward to losing some of the unseemly warts. You know. The kinds of things that make Python seem a little less beautiful. And the kinds of examples that detractors cherry pick to “prove” that Python is really no more elegant than, say, Perl.

Comments are closed.