See http://docs.python.org/3.3/extending/extending.html for a description of what I've done.