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 tim.peters
Recipients tim.peters
Date 2020-02-07.03:39:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org>
In-reply-to
Content
Here under Python 3.8.1 on 64-bit Windows:

>>> import decimal
>>> c = decimal.getcontext()
>>> c.prec = decimal.MAX_PREC
>>> i = decimal.Decimal(4)
>>> i / 2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError

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

The implicit conversion is irrelevant:

>>> i / decimal.Decimal(2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError

Floor division instead works fine:

>>> i // 2
Decimal('2')
History
Date User Action Args
2020-02-07 03:39:20tim.peterssetrecipients: + tim.peters
2020-02-07 03:39:20tim.peterssetmessageid: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org>
2020-02-07 03:39:20tim.peterslinkissue39576 messages
2020-02-07 03:39:19tim.peterscreate