[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

Vedran Čačić report at bugs.python.org
Fri Feb 7 01:44:43 EST 2020


Vedran Čačić <vedgar at gmail.com> added the comment:

> Of course the result is exactly 2.  Which I have enough RAM to hold ;-)

You might think so, but if you write it as 2.00...0 with 

>>> decimal.MAX_PREC
999999999999999999

zeros, I think you're overestimating your RAM capacity. :-P

Now, what is the exact significance of MAX_PREC, I don't know. But I guess some hard limits were needed for standards compliance, and Python didn't want to limit you there. Of course, same as with recursionlimit, it might be better to actually have some reasonable _lower_ limit that we know is actually safe.

----------
nosy: +veky

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


More information about the Python-bugs-list mailing list