Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(29)

Issue 602: range: lean and mean (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 12 months ago by Benjamin
Modified:
10 years, 6 months ago
Reviewers:
GvR
Base URL:
http://svn.python.org/view/*checkout*/python/branches/py3k/
Visibility:
Public.

Description

Per discussions on Python-3000, I've stipped range down to a bare minimum. Here's an overview of the patch: 1. No slicing. 2. Length is computed in constructor and is a PyLong in the object's struct. __len__ simply tries to convert it to a Py_ssize_t. 3. start, stop, and, step are exposed as attributes

Patch Set 1 #

Patch Set 2 : use PyMemberDef #

Patch Set 3 : in response to reviews #

Patch Set 4 : __len__ is back! #

Patch Set 5 : address more concerns #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -117 lines) Patch
Lib/ctypes/test/test_slicing.py View 4 2 chunks +8 lines, -8 lines 0 comments Download
Lib/test/pickletester.py View 4 1 chunk +1 line, -1 line 0 comments Download
Lib/test/seq_tests.py View 4 1 chunk +1 line, -1 line 0 comments Download
Lib/test/test_deque.py View 4 1 chunk +1 line, -1 line 0 comments Download
Lib/test/test_enumerate.py View 4 1 chunk +1 line, -1 line 0 comments Download
Lib/test/test_heapq.py View 4 1 chunk +1 line, -1 line 0 comments Download
Lib/test/test_mutants.py View 4 1 chunk +2 lines, -2 lines 0 comments Download
Lib/test/test_operator.py View 4 2 chunks +2 lines, -2 lines 0 comments Download
Lib/test/test_random.py View 4 3 chunks +4 lines, -4 lines 0 comments Download
Lib/test/test_range.py View 1 2 3 4 1 chunk +28 lines, -5 lines 0 comments Download
Lib/test/test_set.py View 4 3 chunks +3 lines, -3 lines 0 comments Download
Lib/test/test_trace.py View 4 2 chunks +2 lines, -2 lines 0 comments Download
Objects/rangeobject.c View 1 2 3 4 20 chunks +59 lines, -86 lines 0 comments Download

Messages

Total messages: 9
mvloewis_gmail.com
http://codereview.appspot.com/602/diff/1/21 File Objects/rangeobject.c (right): http://codereview.appspot.com/602/diff/1/21#newcode17 Line 17: PyObject *length; What is the purpose of caching ...
15 years, 12 months ago (2008-05-02 05:43:57 UTC) #1
GvR
http://codereview.appspot.com/602/diff/1/22 File Lib/test/test_range.py (right): http://codereview.appspot.com/602/diff/1/22#newcode72 Line 72: self.assertEqual(r.step, 1) I'd like the test to be ...
15 years, 12 months ago (2008-05-02 13:52:48 UTC) #2
GvR
Hey musiccomposition, can you add the second patch from the bug issue to this review ...
15 years, 12 months ago (2008-05-02 14:23:01 UTC) #3
Benjamin
http://codereview.appspot.com/602/diff/1/21 File Objects/rangeobject.c (right): http://codereview.appspot.com/602/diff/1/21#newcode17 Line 17: PyObject *length; On 2008/05/02 05:43:57, mvloewis wrote: > ...
15 years, 12 months ago (2008-05-02 16:56:18 UTC) #4
mvloewis_gmail.com
http://codereview.appspot.com/602/diff/141/83 File Objects/rangeobject.c (right): http://codereview.appspot.com/602/diff/141/83#newcode288 Line 288: range_members, /* tp_members */ Carrying forward from the ...
15 years, 12 months ago (2008-05-02 20:17:20 UTC) #5
GvR
Here are a few more comments, Benjamin. http://codereview.appspot.com/602/diff/243/183 File Lib/test/test_range.py (right): http://codereview.appspot.com/602/diff/243/183#newcode71 Line 71: self.assertEqual(r.step, ...
15 years, 12 months ago (2008-05-03 05:04:36 UTC) #6
Alexandre Vassalotti
http://codereview.appspot.com/602/diff/222/306 File Lib/test/pickletester.py (right): http://codereview.appspot.com/602/diff/222/306#newcode588 Line 588: oob = list(protocols)[-1] + 1 # a future ...
15 years, 12 months ago (2008-05-03 07:12:02 UTC) #7
Benjamin
one reply http://codereview.appspot.com/602/diff/222/302 File Lib/ctypes/test/test_slicing.py (right): http://codereview.appspot.com/602/diff/222/302#newcode23 Line 23: a[0:5] = list(range(5, 10)) On 2008/05/03 ...
15 years, 12 months ago (2008-05-03 17:18:39 UTC) #8
GvR
15 years, 10 months ago (2008-06-16 03:23:15 UTC) #9
Feel free to close this, the corresponding bug has been closed (rejected).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b