Message257090
Keeping the API small is a good reason against it.
There aren't many ways to destructure a Decimal though: As far
as I know, the return value of as_tuple() dates back from the time
when the coefficient was actually a tuple. The function is slow
and not really nice to use.
Probably many people would be happy if we added as_integer_ratio()
and an as_triple() function that represents the coefficient as
an integer.
> Off-topic: I wonder whether `int.as_integer_ratio` should be implemented (for the same reasons that `int.numerator`, `int.real` and so on are).
If users want to duck-type, I think yes. |
|
Date |
User |
Action |
Args |
2015-12-27 19:53:37 | skrah | set | recipients:
+ skrah, rhettinger, terry.reedy, mark.dickinson, belopolsky, steven.daprano, serhiy.storchaka, johnwalker |
2015-12-27 19:53:37 | skrah | set | messageid: <1451246017.58.0.791389277378.issue25928@psf.upfronthosting.co.za> |
2015-12-27 19:53:37 | skrah | link | issue25928 messages |
2015-12-27 19:53:37 | skrah | create | |
|