Some of the way towards py3k porting.