Author vstinner
Recipients Dave Hibbitts, RazerM, georg.brandl, mark.dickinson, paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware
Date 2016-02-24.09:21:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456305699.45.0.976584034339.issue26423@psf.upfronthosting.co.za>
In-reply-to
Content
I tested Python 2.7 on Windows, downloaded from python.org:

* 32-bit:

  - 'x'*(2**31+5) fails with OverflowError as expected
  - len('x' * (sys.maxsize // 2)) returns 2**30-1 as a Python int
  - for length larger with 'x' * (sys.maxsize // 2), I get a MemoryError, probably because of a integer overflow in the C code, or maybe because malloc() failed, I don't know

* 64-bit:

  - len('x' * (2**32 + 5)) returns 2**32 + 5 (a positive number) as a Pyhon long
  - len('x' * (2**31 + 5)) returns 2**31 + 5 (a positive number) as a Pyhon long
  - len('x' * (2**31 - 5)) returns 2**31 - 5 (a positive number) as a Pyhon int

Limits :

* 32-bit: sys.maxint == 2**31-1, sys.maxsize == 2**31-1 == sys.maxint
* 64-bit: sys.maxint == 2**31-1, sys.maxsize == 2**63-1


It looks like the issue is specific to Python compiled by Continuum ("Anaconda" flavor)?
History
Date User Action Args
2016-02-24 09:21:39vstinnersetrecipients: + vstinner, georg.brandl, paul.moore, mark.dickinson, pitrou, tim.golden, zach.ware, steve.dower, RazerM, Dave Hibbitts
2016-02-24 09:21:39vstinnersetmessageid: <1456305699.45.0.976584034339.issue26423@psf.upfronthosting.co.za>
2016-02-24 09:21:39vstinnerlinkissue26423 messages
2016-02-24 09:21:38vstinnercreate