Message155085
| Author |
skrah |
| Recipients |
Amaury.Forgeot.d'Arc, Jim.Jewett, Ramchandra Apte, amaury.forgeotdarc, benjamin.peterson, casevh, ced, eric.smith, eric.snow, jjconti, lemburg, mark.dickinson, pitrou, rhettinger, skrah, vstinner |
| Date |
2012年03月07日.13:22:59 |
| SpamBayes Score |
7.928308e-11 |
| Marked as misclassified |
No |
| Message-id |
<20120307132258.GA4435@sleipnir.bytereef.org> |
| In-reply-to |
<1331109001.85.0.604470016125.issue7652@psf.upfronthosting.co.za> |
| Content |
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. |
|
History
|
|---|
| 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 |
|