2006-02-28

PyCon sprints, day 1 & 2

Day 1 of the sprints was spent doing three things: reading and applying Michael Hudson's new-style exception patch, writing the unit tests for PEP 352, and dealing with a minor bug that was a bitch to debug. Turned out that the PendingDeprecationWarning for raising string exceptions never had its return value for PyErr_Warn() checked. This was a problem if a warnings filter with an error action caught the deprecation because it didn't know it needed to raise a new exception instead of setting the original exception. Try debugging when you trace to where an exception is raised, check that something being raised is correct, and then end up with a different exception in the end. Joys of mucking around with a fundamental piece of machinery that you rely upon to detect errors. =)

Anyway, it got fixed and backported on day 1. I then moved forward with implementing the PEP stuff during day 2. Had some random bugs that usually stemmed from me not thinking about a possibility or random C stuff. But that all got straightened out.

One of the tricks I had stemmed from when I implemented the PEP wrong. I actually made it so that any new-style class could be raised as an exception for about an hour on my laptop. That meant that you could raise 42 or an empty dict. But everyone here said that was insane and that was not what Guido meant. The thing that put me over was when Tim channeled Guido and said what I had done was wrong. So I backed it out so that now you can raise strings (which are now raise a DeprecationWarning), classic classes, and built-in exceptions which are new-style.


Beyond some cleanup to PEP 3000, that has been what I have been working on the past two days. The plan is that the next two will be spent on the exception docs and whatever else I feel like working on.