The patch applies cleanly, and the regression tests pass on python2 when cdecimal is not installed. When it is, the type info returned for the converted numeric value is cdecimal.Decimal instead of decimal.Decimal.
The regression tests expected output have not been modified for python3, and as such they fail on the type conversions.
I am a bit confused with the use of PyModule_GetDict: shouldn't PyObj_GetAttrString be used directly instead ? Moreover, the reference count in the current implementation might be off: the reference count for the decimal module is never decreased, while the reference count to the module dict is, when the docs say it returns a borrowed reference.
Please find a patch that fixes both issues.
Thanks for the patch. I assume you generated that from clean trunk, and it includes all the changes (mine and yours) right?
I've checked the patch, everything looks great.
I've attached it to this email with changed name, just for consistent naming in commitfest app.