<div dir="ltr"><div class="gmail_default" style="font-size:small">On Tue, Jul 17, 2018 at 11:44 PM, Paul G <span dir="ltr"><<a href="mailto:paul@ganssle.io" target="_blank">paul@ganssle.io</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In many languages numeric types can't hold arbitrarily large values, and I for one hadn't really previously recognized that if you read in a numeric value with an exponent that it would be represented *exactly* in memory (and thus one object with a very compact representation can take up huge amounts of memory). It's also not *inconceivable* that under the hood Python would represent fractions.Fraction("1.<wbr>64E6646466664") "lazily" in some fashion so that it did not consume all the memory on disk.<br>
<br></blockquote><div><div class="gmail_default" style="font-size:small;display:inline">​Sooner or later you are going to need the digits of the number to perform a computation. Exactly when would you propose the deferred evaluation should take place?</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">There are already occasional inquiries about the effects of creation of such large numbers and their unexpected effects, so they aren't completely unknown. At the same time, this isn't exactly a mainstream "bug", as evidenced by the fact that such issues </div><div class="gmail_default" style="display:inline">​</div> <div class="gmail_default" style="font-size:small;display:inline">​are relatively rare.</div></div><div><div class="gmail_default" style="font-size:small;display:inline">​</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It seems to me that "Hey by the way the size of this thing is unbounded and because of exponents small strings can expand to huge objects" is a good tip.<br><span class=""><br></span></blockquote><div><div class="gmail_default" style="font-size:small;display:inline">​Not an unreasonable suggestion. Perhaps you could draft a documentation change - personally I'm not even sure where the best place for the warning would be.</div></div><div><div class="gmail_default" style="display:inline">​</div> <br></div></div></div></div>