svfgit / tinypy

Automatically exported from code.google.com/p/tinypy
Other
0 stars 0 forks source link

Range misbehaves when step size is 0 or steps over the end value #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- Call range() with mischievous parameters:
- range(0,1,0)
- range(0,5,3)

What is the expected output? What do you see instead?
- Expect a valid list (maybe empty), instead vm consumes vast amounts of 
memory as very long lists are built (can be an infinite loop until RAM is 
exhausted).

What version of the product are you using? On what operating system?
- r3, Mac OS X / 10.4.11 / PPC.

Please provide any additional information below.
- Patch with unit tests and fix will be appended to this issue.

Original issue reported on code.google.com by dwhall...@gmail.com on 24 Apr 2008 at 5:31

GoogleCodeExporter commented 9 years ago
I merged up to r5, no conflicts.  I added code that will also fix issue #2, 
allowing 
range() to take 1 arg.  Maillist discussion is here:
http://groups.google.com/group/tinypy/browse_thread/thread/13418ffea7af6c21

Original comment by dwhall...@gmail.com on 25 Apr 2008 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
I grouped my range() unit tests into a function "test_range" in tests.py that 
is called 
by the default build; they all run w/o error.

Original comment by dwhall...@gmail.com on 25 Apr 2008 at 6:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by philhas...@gmail.com on 26 Apr 2008 at 12:12