This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients Jean Abou Samra, facundobatista, mark.dickinson, rhettinger, skrah
Date 2020-07-16.22:19:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594937997.59.0.909463033714.issue41315@roundup.psfhosted.org>
In-reply-to
Content
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')
History
Date User Action Args
2020-07-16 22:19:57skrahsetrecipients: + skrah, rhettinger, facundobatista, mark.dickinson, Jean Abou Samra
2020-07-16 22:19:57skrahsetmessageid: <1594937997.59.0.909463033714.issue41315@roundup.psfhosted.org>
2020-07-16 22:19:57skrahlinkissue41315 messages
2020-07-16 22:19:57skrahcreate