PMC: recode to_py_dict to work around ubuntu 10.04 swig throwing stop iteration