The v2 patch does not work for me: regression tests for plpython fail on the plpython_types test: every numeric is converted to None.
It seems the global decimal ctor is not initialized.
Please find two patches, to be applied on top of the v2 patch: one initializes the decimal ctor, the other uses cdecimal when possible.
Using the performance test from steve, on my machine:
- with cdecimal installed: ~84ms
- without cdecimal installed (standard decimal module): ~511ms