... otherwise this code will fail for Python 2.6 since it cannot pickle partial functions by default