Stefan Krah <[email protected]> added the comment:
The top level decimal.py that dispatches to either _decimal or
_pydecimal is pure Python. So perhaps these applications could
add these methods themselves:
>>> import decimal
>>> def exp(x):
... return x.exp()
...
>>> decimal.exp = exp
>>>
>>> from decimal import *
>>> exp(Decimal(2))
Decimal('7.389056098930650227230427461')
As you see, it is no big deal, but it feels a bit odd to have
some methods like exp() and sqrt() exposed in the top level.
We already have:
Decimal.exp()
And:
>>> c = getcontext()
>>> c.exp(Decimal(2))
Decimal('7.389056098930650227230427461')
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41315>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com