homepage

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 nnorwitz
Recipients
Date 2007年04月21日.04:14:51
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
You could always check the value of sys.maxint. The test_bigrepeat below fails quickly on a 64-bit box if you don't have enough memory. :-) If you calculated 16 in the __mul__ calls based on sys.maxint, wouldn't that do what you want?
Perhaps something like:
reasonable_exp = 16
x *= 2 ** reasonable_exp
overflow_exp = int(math.log(sys.maxint, 2)) + 1 - reasonable_exp
self.assertRaises(MemoryError, x.__mul__, 2**overflow_exp)
History
Date User Action Args
2007年08月23日 15:58:11adminlinkissue1704621 messages
2007年08月23日 15:58:11admincreate

AltStyle によって変換されたページ (->オリジナル) /