I wonder if it wouldnt make sense to create a "set partition" utility function. There's chatter on python-dev this week to create one, and we seem to have this kind of pattern a few times in buildbot.