Message210491
In principle, your approach using itertools.groupby, the existing _sum, your decimalsum, and my _ExactRatio class could be combined.
You could call decimalsum for Decimal and subclasses, the current _sum for everything else.
_sum would return an _ExactRatio instance now anyway, just modify decimalsum accordingly and you are done.
The problem I see is that it would cause a slow down in many cases where no Decimals or just a few are involved (think of mixes of ints and floats as a realistic scenario, and consider also that you would have to do an isinstance check to catch subclasses of Decimal). |
|
Date |
User |
Action |
Args |
2014-02-07 16:46:52 | wolma | set | recipients:
+ wolma, steven.daprano, skrah, oscarbenjamin |
2014-02-07 16:46:52 | wolma | set | messageid: <1391791612.17.0.102873784248.issue20499@psf.upfronthosting.co.za> |
2014-02-07 16:46:52 | wolma | link | issue20499 messages |
2014-02-07 16:46:52 | wolma | create | |
|