Showing posts with label release. Show all posts
Showing posts with label release. Show all posts

Saturday, September 29, 2012

Python 3.3 is my Favorite Python Release

Today, Python 3.3 was released. During the 4.5 years I've been a CPython core developer, 6 major Python releases (2.6, 2.7, 3.0, 3.1, 3.2, and 3.3) have past by me. In this post, I will explain why 3.3 is the most exciting Python release to me. I will be cherrypicking, consult "What's New in Python 3.3" and the Misc/NEWS file for complete details.

Unicode

PEP 393 completely changed the internal format of Python's Unicode implementation. It does away with the concept of wide and narrow unicode builds. The encoding of a string now depends on its maximum codepoint; there are 1-byte, 2-byte, or 4-byte strings internally. This means, for example, that strings with only ASCII characters can be represented in their most compact format. Partially as a consequence, Unicode standard compilance has improved. Indexing strings always gives code points not surrogates like on < 3.3 narrow builds. str.lower(), str.upper(), and str.title() have been fixed to use full Unicode case-mappings instead of the simple 1-1 ones. The str.casefold method implements the Unicode casefolding algorithm.
If the gods of PyCon talk selection smile on me, I will be giving a talk about this and the history of Unicode in Python.

Glorious Return of the "u" Prefix

Python 3.3 allows the u in front of strings again. Since the b prefix is supported from Python 2.6, code which wants to support 2.x and 3.3 shouldn't need to use unpleasant kludges like six's u() and b() functions. I don't think it would be unreasonable for libraries to only support 2.7 and 3.3+ now just to have the more natural string syntaxes.

Many Nice Things

One of the annoyances in previous Python 3 versions was it was impossible to turn off PEP 3134's implicit exception chaining. The raise exc from None syntax introduced in 3.3 prevents the __context__ of an exception from being printed.
There were improvements in exceptions themselves. PEP 3151 merged IOError, OSError, WindowsError, and various error types in the standard library. It also created a hierarchy of specialized exception subclasses. This means that most code dealing with IO errors won't have to dig into the errno module. For example, this standard pattern
try:
    fp = open("data", "rb")
except OSError as e:
    if e.errno != errno.ENOENT:
        raise
    # Create file
can become
try:
    fp = open("data", "rb")
except FileNotFoundError:
    # Create file
. (Of course, for this sort of thing you can also use the new "x" mode in open().) The errors from incorrect call signatures have improved:
Python 3.3.0+ (3.3:7e83c8ccb1ba, Sep 29 2012, 10:34:54) 
[GCC 4.5.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def f(a, b, c=5, *, kw1, kw2): pass
... 
>>> f(1, kw2=42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() missing 1 required positional argument: 'b'
>>> f(1, 2, kw2=42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() missing 1 required keyword-only argument: 'kw1'
In the future, I think there should be a ArgumentsError subclass of TypeError which provides programmatic access to the signature mismatch, but this is a start. The new standard library modules, ipaddress, lzma, a dn unittest.mock are certainly worth a look.
The Windows installer has an option to set up PATH for you.







Tuesday, March 15, 2011

six 1.0.0 final finally released

I finally found time to release six 1.0.0. six is a Python 2 and 3 compatibility library. You can find the documentation and download it on PyPI.

There haven't been many changes since the beta: one bugfix and one new advanced feature. The bugfix is that unicode escapes are now properly decoded with the u() fake literal in both Python 2 and 3. The feature is that there is now an api for adding items to the "six.moves" interface. This was requested by ActiveState, which uses six in the ActivePython package manager.

Enjoy!

Saturday, June 27, 2009

Python 3.1 released!

I'm happy to announce that today Python 3.1 was released. I won't dwell the new features, since those are more completely listed elsewhere. I'm quite happy with this release. A lot of work has been put into 3.x as stable as its older 2.x siblings. I would like to see a lot of libraries and applications start serious looking at the port to 3.x now. As always there's a bunch of core developers waiting to help on the python-porting mailing list.

Anyway, 3.1 is available for download in source and several binary formats on python.org.

Wednesday, May 6, 2009

Python 3.1 beta 1 released

I'm pleased to announce that the first beta of Python 3.1 has been released. In addition to the features found in the previous alphas, the beta has several more improvements. Most importantly, I think, is PEP 383. It defines a way for undecodable paths in file systems to be safely round tripped from Unicode strings. The repr of floats also now uses a new algorithm which determines the shortest possible value.

It is planned that this will be the only beta in order for 3.1 to make a final in late June. Please download it and try it out. This is 3.x's future, and in my opinion, much of an improvement. As always, you can submit any problems you see to bugs.python.org

Saturday, February 14, 2009

Python 3.0.1 released

The first bugfix release, 3.0.1, of the new Python 3.x series has been released! Many embarrassing bugs have been fixed. Among other things:


  • The wsgiref package has been fixed for 3.x.

  • A few hideous bugs in the new IO implementation have been squashed. In addition, a few cases have been optimized. (Note that IO in 3.x is still quite a bit slower than 2.x; more on that later.)

  • Unbuffered standard streams (the "-u" flag) have been restored.



This is actually a bit more than an average point release. Somehow, the builtin cmp() and __cmp__ slipped into the final release and has been removed in 3.0.1.

Our next goal is 3.1. We plan to compress our rather huge release cycle to make 3.1 between 1/2 and 1 year after 3.0. The focus of 3.1 will be stabilizing the feature set and change in 3.x. This is includes the rewrite of IO in C for speed and Brett's rewrite of import in Python.

Wednesday, December 3, 2008

Is it all futile?

Today, the much anticipated Python 3.0 final was released. Truly, this is a historic release for the Python community, the first intentional incompatible Python release. It's been a long time in the making, and I applaud everybody who is responsible for proving Py3k is not vaporware. Guido and the other decision makers on Python-dev also deserve credit for not making py3k changes too gratuitous; many revolutionary ideas and features were proposed and rejected. I have every confidence that every incompatibility was well thought out. Much thought has also been given to making the transition as easy as possible for the community. The suggested migration path, fixing Py3k warnings in 2.6 and then applying 2to3, has been used with a fair amount of success on several projects. We've even had several Py3k love letters!

Still, I can't help being a little worried. I think the bytes and str divide will be difficult for people especially with IO where everything has to be dealt with in bytes. We may see many "x.encode('ascii')" lines popping up all over codebases. Userland libraries will need to maintain compatibility with 2.4 and 2.5 for a while; that significantly complicates the dream of maintaining just one branch for 2.x and py3k. 2to3 is not even close to perfect and will only correct the surface incompatibilities of syntax between the versions. I'm also concerned about burn out. The excitement of a new major version will certainly spur an interest in porting for a few months, but I suspect it won't be so fun after the aura wears off a bit. I hope common base libraries (PIL, Twisted, lxml, etc...) are ported soon. It will build the bridge for everything else to cross over too.

Of course, what I'm forgetting is the amazing Python community. Whatever the results, a new era has certainly begun. We just need time.

Wednesday, October 1, 2008

Python 2.6 released!

Fire the cannons! Begin the fireworks! Scream at the top of your lungs! Clink your glasses! Python 2.6 is here! Download it, and learn what's new.

This is my first final python release on the core team, and I'm quite proud of our baby. :)

Sunday, September 14, 2008

2.6 RC 1 is out

If you didn't already know it, 2.6 RC 1 was released two days ago. There's nothing big to report (and there shouldn't be of course!). In fact, the biggest change you may notice is the absence of a 3.0 RC alongside. This is due to the fact that we believe although 2.6 is almost rock solid, 3.0 definitely still needs some more TLC. We are still aiming for a 2.6 final on October 1st, but 3.0 has been pushed back to the 15th. (You can, of course, see the whole release schedule in PEP 361.) Please, please, please take the time to download it and test it with your project; now is when we want to know about grotesque bugs and incompatibilities!

Thursday, August 21, 2008

The third betas are out!

Last night, Barry released the third and final betas for Python 2.6 and 3.0. This release really saw a monumental effort from everyone. Tuesday was filled with coding, code reviews, and bug fixes, and we were able to close all 10 release blockers. It was looking very bright for a release yesterday morning. (Including the fantastic omen of a green Windows buildbot.) That didn't stop another release blocker from popping up hours before the release. However, we were able to get that one fixed due to some excellent debugging on the parts of Amaury Forgeot d'Arc, Antoine Pitrou, and Victor Stinner. Highlights:

  • A more completed memoryview implementation. (Once again thanks to Antoine.

  • I fixed up the symtable module and wrote unittests and docs for it. It should actually be functional now...

  • The threading API was renamed once again. Now daemon, and name are properties of the Thread object. (That's the last time I'm doing threading renaming I assure you!)

  • multiprocessing has gotten more stable.

  • Guido donated the SRE bytecode validator he wrote for the App Engine.

  • Many, many, many little bug fixes.



Of course, there's still lots of work to do before we can get to release candidates. Hours after the release we already have 11 release blockers. In the mean time, I strongly encourage you to download 2.6 and 3.0 and test them with your project. The bug tracker is still there: http://bugs.python.org

Friday, July 18, 2008

The Second betas are out!

Our release manager, Barry Warsaw, has just released (I prefer unleashed) Python 2.6 and 3.0 beta 2 in the big, wild world. Highlights (that I can recall) include:


  • Installing on Mac for 3.0 is fixed.

  • test_multiprocessing hangs have been fixed.

  • gettext has gotten a different API.

  • Tracebacks now display their causes and contexts. See exception chaining.

  • Antoine Pitrou got commit access. Yeah!



Even now, the planned final release date in October looms, so we need lots of people to test their application and libraries with the beta release and file bug reports.

Thursday, June 19, 2008

The betas are out!

Yesterday, Barry released the first betas for Python 2.6 and 3.0. Highlights that I remember (look in Misc/NEWS for all the gory details) include:

Now that the 2.6 and 3.0 are almost feature complete, (It was just noticed yesterday that some points of PEP 3118 have not been implemented. They will have to go in post-beta.) we can switch gears and start grinding on the bugs. What I seen so far on the tracker is already impressive. We've gotten at least 10 new issues mentioning the betas. Hopefully, the bug days this weekend will be able to stamp out many of them.