Message155085
Case Van Horsen <report@bugs.python.org> wrote:
> cdecimal 2.3 does not support the __ceil__ and __floor__
Thanks. I'll look into that.
> cdecimal.Decimal instances do not emulate the various single-underscore methods of a decimal.Decimal instance. In gmpy2, I use _int, _exp, _sign, and _is_special to convert a decimal.Decimal into an exact fraction. I realize the issue is with gmpy2 and I will fix gmpy2, but there may be other code that uses those methods.
There seems to be a real need for getting (sign, coeff, exp). I think
psycopg2 uses a painful way to get an integer coefficient via as_tuple().
What should really be added is either as_triple(), which would return
(sign, coeff, exp) with an integer coefficient or make these attributes
official:
Decimal.sign
Decimal.coeff
Decimal.exp
I have to think about implementing Decimal._int etc. Somehow I feel that
doing so would send a wrong signal: People shouldn't assume that they'll
get away with using private methods and attributes.
Also, of course they'll keep using these private methods until they
are finally deprecated, and *then* they'll have to change things. |
|
Date |
User |
Action |
Args |
2012-03-07 13:23:00 | skrah | set | recipients:
+ skrah, lemburg, rhettinger, amaury.forgeotdarc, mark.dickinson, pitrou, vstinner, casevh, eric.smith, benjamin.peterson, jjconti, ced, Amaury.Forgeot.d'Arc, eric.snow, Ramchandra Apte, Jim.Jewett |
2012-03-07 13:22:59 | skrah | link | issue7652 messages |
2012-03-07 13:22:59 | skrah | create | |
|