Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42543

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.090
X-Spam-Evidence '*H*': 0.82; '*S*': 0.00; 'exception.': 0.09; 'subject:Why': 0.09; "wouldn't": 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sooner.': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; 'have,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'cap': 0.31; "we're": 0.32; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'skip:> 10': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'skip:u 10': 0.60; 'lower': 0.61; 'more': 0.64; 'seriously,': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=BjNr4MQJDJZFOw+CUS0REZmeYZE0oEMVKKhFXMtxlvE=; b=rWi0vHKOg1FE6zuw3C87GKTESclyaru/H9IgTUHdgIJUHnuy8d6wrryOX6Tpf1sFwq g3zhJGIujZ99XJ6l7A25mwoE+ZfZl1nM5aYddE4EJslCPgJGps4zIQ/mdkpbfDW+B8b8 +topaCFAK8DnkpyRVVXITMU6/Q0XopdaOaLrtfYAsvZoxkIrYyAb+IUU46U4gTPBDJ1l 00MoSg8IflF9rERN/xJV1xQVo9Io+ZiWuV/rWDdnTwhzzaFQIC0OkTmIIXklf13e0KNe TNtkZDlnT1HiHFwOIWDAw8hBZa3uNx+rUiUgW5nTWBsL7A3GpFWCCVkjb8WQ8Z0Wpb++ kgjA==
MIME-Version 1.0
X-Received by 10.220.231.199 with SMTP id jr7mr11396434vcb.70.1364883389152; Mon, 01 Apr 2013 23:16:29 -0700 (PDT)
In-Reply-To <sgokl856osiaifts4d5k1ua5avsck5spk3@4ax.com>
References <8e43bc87-e822-4bb3-b9ef-ccd489da8bf3@googlegroups.com> <5157e6cc$0$29974$c3e8da3$5496439d@news.astraweb.com> <8276eff6-9e5c-4060-b9e8-94fab606206f@googlegroups.com> <sgokl856osiaifts4d5k1ua5avsck5spk3@4ax.com>
Date Tue, 2 Apr 2013 17:16:28 +1100
Subject Re: Why does 1**2**3**4**5 raise a MemoryError?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.29.1364883391.17481.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364883391 news.xs4all.nl 6852 [2001:888:2000:d::a6]:50698
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42543

Show key headers only | View raw


On Tue, Apr 2, 2013 at 3:45 PM, Tim Roberts <timr@probo.com> wrote:
> morphex <morphex@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?

And If you want a lower cap than the one you currently have, check out
ulimit/rlimit - you can trigger MemoryError sooner.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does 1**2**3**4**5 raise a MemoryError? morphex <morphex@gmail.com> - 2013-03-30 23:56 -0700
  Re: Why does 1**2**3**4**5 raise a MemoryError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-31 07:33 +0000
    Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 03:48 -0400
    Re: Why does 1**2**3**4**5 raise a MemoryError? morphex <morphex@gmail.com> - 2013-03-31 05:07 -0700
      Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <d@davea.name> - 2013-03-31 08:43 -0400
        Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 09:15 -0400
          Re: Why does 1**2**3**4**5 raise a MemoryError? Jason Swails <jason.swails@gmail.com> - 2013-03-31 10:03 -0400
      Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 09:04 -0400
      Re: Why does 1**2**3**4**5 raise a MemoryError? Tim Roberts <timr@probo.com> - 2013-04-01 21:45 -0700
        Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-02 17:16 +1100
        Re: Why does 1**2**3**4**5 raise a MemoryError? Dan Sommers <dan@tombstonezero.net> - 2013-04-02 12:56 +0000
    Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 08:59 -0400
  Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 03:34 -0400
    Re: Why does 1**2**3**4**5 raise a MemoryError? "Alex" <foo@email.invalid> - 2013-03-31 22:06 +0000
      Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 09:28 +1100
        Re: Why does 1**2**3**4**5 raise a MemoryError? "Alex" <foo@email.invalid> - 2013-04-01 00:39 +0000
          Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 11:58 +1100
          Re: Why does 1**2**3**4**5 raise a MemoryError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-01 04:16 +0000
            Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-04-01 07:48 -0400
          Re: Why does 1**2**3**4**5 raise a MemoryError? Nobody <nobody@nowhere.com> - 2013-04-02 08:40 +0100
      Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 09:32 +1100
      Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 18:34 -0400

csiph-web