[issue15882] _decimal.Decimal constructed from tuple

Mark Dickinson report at bugs.python.org
Sat Sep 8 12:51:09 CEST 2012


Mark Dickinson added the comment:

> So, I'd really like to deprecate the whole interface in favor of either a
> read-only interface:
>
>     x.sign   -> 0 or 1 (perhaps even 1 or -1)
>     x.coeff  -> Python integer
>     x.exp    -> Python integer
> 
> If x is special, raise InvalidOperation. People usually need to check for
> specials anyhow.

Sure;  that works for me.  I don't like the current interface any more than you do, and I've always found it unnecessarily awkward to turn finite decimals into triples and back again.

But I think that's a different issue.  What we have here is a real regression that seems likely to break existing code, and I think that should be fixed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15882>
_______________________________________


More information about the Python-bugs-list mailing list