[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-25 Thread Markus F.X.J. Oberhumer
Markus F.X.J. Oberhumer added the comment: Many thanks for your quick fix! ~Markus -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: Backported to release30-maint branch in r73549. Thanks for catching this, Markus! -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: Applied to py3k in r73547. Will backport to 3.0. -- versions: -Python 3.1 ___ Python tracker ___ _

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: The patch looks good. Please apply. -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Mark Dickinson
Changes by Mark Dickinson : -- stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch for py3k. There are also a whole bunch of tests that are commented out in BuiltinTest.test_range in Lib/test/test_builtin.py. Some of those tests fail with the current py3k; with this patch applied, they all pass except the one involving 'badzer

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Mark Dickinson
Mark Dickinson added the comment: The length calculation in range_iter in Objects/rangeobject.c is incorrect, when using a longrangeiterobject. The length is computed as: (stop - start)//step. It should be ceiling((stop-start)/step), or 1 + (stop - start - 1)//step, provided that start <= st

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Ezio Melotti
Ezio Melotti added the comment: Simpler test case: Py2.6: >>> n = 46349**2 >>> n 2148229801L >>> range(n-10, n, 3) [2148229791L, 2148229794L, 2148229797L, 2148229800L] Py3.0: >>> n = 46349**2 >>> n 2148229801 >>> list(range(n-10, n, 3)) [2148229791, 2148229794, 2148229797] -- nosy: +ez

[issue6334] 3.0/3.1: Bad bug in range() computation (or possible Integer problem)

2009-06-24 Thread Markus F.X.J. Oberhumer
New submission from Markus F.X.J. Oberhumer : Please note that the correct answer is 25, and the last element is missing ! This bug does not show on 64-bit versions (but 46337**2 is near 2**31). ~Markus C:\Python31>python Python 3.1rc2 (r31rc2:73414, Jun 13 2009, 16:43:15) [MSC v.1500 32 bit