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


Groups > comp.lang.python > #42357

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

X-Received by 10.224.72.199 with SMTP id n7mr5780395qaj.5.1364713007087; Sat, 30 Mar 2013 23:56:47 -0700 (PDT)
X-Received by 10.49.81.198 with SMTP id c6mr490722qey.37.1364713007025; Sat, 30 Mar 2013 23:56:47 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!ca1no18410595qab.0!news-out.google.com!v17ni6816qad.0!nntp.google.com!ca1no18410589qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Sat, 30 Mar 2013 23:56:46 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=89.162.57.124; posting-account=5T8gZQkAAACZjNiEpmjzin6sGFqGsOxu
NNTP-Posting-Host 89.162.57.124
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <8e43bc87-e822-4bb3-b9ef-ccd489da8bf3@googlegroups.com> (permalink)
Subject Why does 1**2**3**4**5 raise a MemoryError?
From morphex <morphex@gmail.com>
Injection-Date Sun, 31 Mar 2013 06:56:47 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:42357

Show key headers only | View raw


Hi.

I was just doodling around with the python interpreter today, and here is the dump from the terminal:

morphex@laptop:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:53:58) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1**2
1
>>> 1**2**3
1
>>> 1**2**3**4
1L
>>> 1**2**3**4**5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError
>>> 

Does anyone know why this raises a MemoryError?  Doesn't make sense to me.

Happy Easter!

-Morten

Back to comp.lang.python | Previous | NextNext 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