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

Delta Between Two Patch Sets: Objects/rangeobject.c

Issue 28376: assertion failure in rangeobject.c
Left Patch Set: Created 3 years, 4 months ago
Right Patch Set: Created 3 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_range.py ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* Range object implementation */ 1 /* Range object implementation */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "structmember.h" 4 #include "structmember.h"
5 5
6 /* Support objects whose length is > PY_SSIZE_T_MAX. 6 /* Support objects whose length is > PY_SSIZE_T_MAX.
7 7
8 This could be sped up for small PyLongs if they fit in a Py_ssize_t. 8 This could be sped up for small PyLongs if they fit in a Py_ssize_t.
9 This only matters on Win64. Though we could use long long which 9 This only matters on Win64. Though we could use long long which
10 would presumably help perf. 10 would presumably help perf.
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 it->len = (long)ulen; 923 it->len = (long)ulen;
924 it->index = 0; 924 it->index = 0;
925 return (PyObject *)it; 925 return (PyObject *)it;
926 } 926 }
927 927
928 static PyObject * 928 static PyObject *
929 rangeiter_new(PyTypeObject *type, PyObject *args, PyObject *kw) 929 rangeiter_new(PyTypeObject *type, PyObject *args, PyObject *kw)
930 { 930 {
931 long start, stop, step; 931 long start, stop, step;
932 932
933 if (PyErr_WarnEx(PyExc_DeprecationWarning,
934 "range_iterator(): creating instances of range_iterator "
935 "by calling range_iterator type is deprecated",
936 1)) {
937 return NULL;
938 }
939
933 if (!_PyArg_NoKeywords("range_iterator()", kw)) { 940 if (!_PyArg_NoKeywords("range_iterator()", kw)) {
934 return NULL; 941 return NULL;
935 } 942 }
936 943
937 if (!PyArg_ParseTuple(args, 944 if (!PyArg_ParseTuple(args,
938 "lll;range_iterator() requires 3 int arguments", 945 "lll;range_iterator() requires 3 int arguments",
939 &start, &stop, &step)) { 946 &start, &stop, &step)) {
940 return NULL; 947 return NULL;
941 } 948 }
942 if (step == 0) { 949 if (step == 0) {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 it->index = PyLong_FromLong(0); 1278 it->index = PyLong_FromLong(0);
1272 if (!it->index) 1279 if (!it->index)
1273 goto create_failure; 1280 goto create_failure;
1274 1281
1275 return (PyObject *)it; 1282 return (PyObject *)it;
1276 1283
1277 create_failure: 1284 create_failure:
1278 Py_DECREF(it); 1285 Py_DECREF(it);
1279 return NULL; 1286 return NULL;
1280 } 1287 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+