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

Side by Side Diff: Modules/_functoolsmodule.c

Issue 27809: _PyObject_FastCall(): add support for keyword arguments
Patch Set: Created 3 years, 2 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 | « Modules/_elementtree.c ('k') | Modules/_pickle.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 1
2 #include "Python.h" 2 #include "Python.h"
3 #include "structmember.h" 3 #include "structmember.h"
4 4
5 /* _functools module written and maintained 5 /* _functools module written and maintained
6 by Hye-Shik Chang <perky@FreeBSD.org> 6 by Hye-Shik Chang <perky@FreeBSD.org>
7 with adaptations by Raymond Hettinger <python@rcn.com> 7 with adaptations by Raymond Hettinger <python@rcn.com>
8 Copyright (c) 2004, 2005, 2006 Python Software Foundation. 8 Copyright (c) 2004, 2005, 2006 Python Software Foundation.
9 All rights reserved. 9 All rights reserved.
10 */ 10 */
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 if (!x || !y){ 485 if (!x || !y){
486 PyErr_Format(PyExc_AttributeError, "object"); 486 PyErr_Format(PyExc_AttributeError, "object");
487 return NULL; 487 return NULL;
488 } 488 }
489 489
490 /* Call the user's comparison function and translate the 3-way 490 /* Call the user's comparison function and translate the 3-way
491 * result into true or false (or error). 491 * result into true or false (or error).
492 */ 492 */
493 stack[0] = x; 493 stack[0] = x;
494 stack[1] = y; 494 stack[1] = y;
495 res = _PyObject_FastCall(compare, stack, 2, NULL); 495 res = _PyObject_FastCall(compare, stack, 2);
496 if (res == NULL) { 496 if (res == NULL) {
497 return NULL; 497 return NULL;
498 } 498 }
499 499
500 answer = PyObject_RichCompare(res, zero, op); 500 answer = PyObject_RichCompare(res, zero, op);
501 Py_DECREF(res); 501 Py_DECREF(res);
502 return answer; 502 return answer;
503 } 503 }
504 504
505 static PyObject * 505 static PyObject *
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 Py_DECREF(m); 1237 Py_DECREF(m);
1238 return NULL; 1238 return NULL;
1239 } 1239 }
1240 name = strchr(typelist[i]->tp_name, '.'); 1240 name = strchr(typelist[i]->tp_name, '.');
1241 assert (name != NULL); 1241 assert (name != NULL);
1242 Py_INCREF(typelist[i]); 1242 Py_INCREF(typelist[i]);
1243 PyModule_AddObject(m, name+1, (PyObject *)typelist[i]); 1243 PyModule_AddObject(m, name+1, (PyObject *)typelist[i]);
1244 } 1244 }
1245 return m; 1245 return m;
1246 } 1246 }
OLDNEW
« no previous file with comments | « Modules/_elementtree.c ('k') | Modules/_pickle.c » ('j') | no next file with comments »

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