Message153506
STINNER Victor <report@bugs.python.org> wrote:
> decimal.Decimal.__truediv__() has an optional context argument, whereas _decimal defines PyNumberMethods.
Regarding the special methods: decimal.py uses the optional context arguments
for convenience so that these methods can be re-used in other places.
I wouldn't consider this context argument as part of the API.
> decimal.Decimal.quantize() second argument is optional and its default value
> is None, but if I pass None to _decimal.Decimal.quantize(), I get a TypeError
> because _decimal expects an integer.
About this I'm not sure. I think type errors are a courtesy to the user.
Look what is possible now in decimal.py:
Decimal('9')
But here the argument might well be made for accepting None (and only
None apart from rounding modes). - I hope Mark and Raymond will give
their opinions, too. |
|
Date |
User |
Action |
Args |
2012-02-16 22:25:53 | skrah | set | recipients:
+ skrah, rhettinger, amaury.forgeotdarc, mark.dickinson, pitrou, vstinner, casevh, eric.smith, jjconti, ced, brian.curtin, Amaury.Forgeot.d'Arc, eric.snow |
2012-02-16 22:25:53 | skrah | link | issue7652 messages |
2012-02-16 22:25:52 | skrah | create | |
|