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. |