[issue41315] Add mathematical functions as wrapper to decimal.Decimal methods

Jean Abou Samra report at bugs.python.org
Thu Jul 16 10:13:33 EDT 2020


New submission from Jean Abou Samra <jean at abou-samra.fr>:

Common mathematical functions such as sqrt(), exp(), etc. are available for decimal numbers as methods of decimal.Decimal instances (like https://docs.python.org/3/library/decimal.html#decimal.Decimal.exp). This does not pair well with the math and cmath modules as well as NumPy and SymPy which all define these as functions. It also makes it harder to switch to decimals instead of floats when you realize that your program lacks arithmetic precision.

It would be nice to have functions in the decimal module that called the corresponding methods. This would unify the interface with other modules while keeping backwards compatibility and preserving the possibility to subclass Decimal.

----------
components: Library (Lib)
messages: 373754
nosy: Jean Abou Samra, facundobatista, mark.dickinson, rhettinger, skrah
priority: normal
severity: normal
status: open
title: Add mathematical functions as wrapper to decimal.Decimal methods
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41315>
_______________________________________


More information about the Python-bugs-list mailing list