Python 3.2 standard library duplicate code

see: This recipe.