Why does 1**2**3**4**5 raise a MemoryError?

Tim Roberts timr at probo.com
Tue Apr 2 00:45:30 EDT 2013


morphex <morphex at gmail.com> wrote:
>
>While we're on the subject, wouldn't it be nice to have some cap there so
>that it isn't possible to more or less block the system with large 
>exponentiation?

There IS a cap.  It's called the "MemoryError" exception.

But, seriously, what would you have it do instead?
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list