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

Side by Side Diff: Objects/iterobject.c

Issue 27809: _PyObject_FastCall(): add support for keyword arguments
Patch Set: Created 3 years, 3 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:
View unified diff | Download patch
« no previous file with comments | « Objects/fileobject.c ('k') | Objects/typeobject.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Iterator objects */ 1 /* Iterator objects */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 4
5 typedef struct { 5 typedef struct {
6 PyObject_HEAD 6 PyObject_HEAD
7 Py_ssize_t it_index; 7 Py_ssize_t it_index;
8 PyObject *it_seq; /* Set to NULL when iterator is exhausted */ 8 PyObject *it_seq; /* Set to NULL when iterator is exhausted */
9 } seqiterobject; 9 } seqiterobject;
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 static PyObject * 208 static PyObject *
209 calliter_iternext(calliterobject *it) 209 calliter_iternext(calliterobject *it)
210 { 210 {
211 PyObject *result; 211 PyObject *result;
212 212
213 if (it->it_callable == NULL) { 213 if (it->it_callable == NULL) {
214 return NULL; 214 return NULL;
215 } 215 }
216 216
217 result = _PyObject_FastCall(it->it_callable, NULL, 0, NULL); 217 result = _PyObject_CallNoArg(it->it_callable);
218 if (result != NULL) { 218 if (result != NULL) {
219 int ok; 219 int ok;
220 220
221 ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ); 221 ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
222 if (ok == 0) { 222 if (ok == 0) {
223 return result; /* Common case, fast path */ 223 return result; /* Common case, fast path */
224 } 224 }
225 225
226 Py_DECREF(result); 226 Py_DECREF(result);
227 if (ok > 0) { 227 if (ok > 0) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 (traverseproc)calliter_traverse, /* tp_traverse */ 278 (traverseproc)calliter_traverse, /* tp_traverse */
279 0, /* tp_clear */ 279 0, /* tp_clear */
280 0, /* tp_richcompare */ 280 0, /* tp_richcompare */
281 0, /* tp_weaklistoffset */ 281 0, /* tp_weaklistoffset */
282 PyObject_SelfIter, /* tp_iter */ 282 PyObject_SelfIter, /* tp_iter */
283 (iternextfunc)calliter_iternext, /* tp_iternext */ 283 (iternextfunc)calliter_iternext, /* tp_iternext */
284 calliter_methods, /* tp_methods */ 284 calliter_methods, /* tp_methods */
285 }; 285 };
286 286
287 287
OLDNEW
« no previous file with comments | « Objects/fileobject.c ('k') | Objects/typeobject.c » ('j') | no next file with comments »

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