[Python-checkins] cpython (3.5): Issue #26822: Decreased an overhead of using _PyArg_NoKeywords() in calls of

serhiy.storchaka python-checkins at python.org
Fri Apr 29 02:13:04 EDT 2016


https://hg.python.org/cpython/rev/54663cbd0de1
changeset:   101176:54663cbd0de1
branch:      3.5
parent:      101174:5c8e1b98dc3f
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Apr 29 09:10:55 2016 +0300
summary:
  Issue #26822: Decreased an overhead of using _PyArg_NoKeywords() in calls of
itemgetter, attrgetter and methodcaller objects.

files:
  Modules/_operator.c |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Modules/_operator.c b/Modules/_operator.c
--- a/Modules/_operator.c
+++ b/Modules/_operator.c
@@ -460,7 +460,7 @@
     PyObject *obj, *result;
     Py_ssize_t i, nitems=ig->nitems;
 
-    if (!_PyArg_NoKeywords("itemgetter", kw))
+    if (kw != NULL && !_PyArg_NoKeywords("itemgetter", kw))
         return NULL;
     if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &obj))
         return NULL;
@@ -749,7 +749,7 @@
     PyObject *obj, *result;
     Py_ssize_t i, nattrs=ag->nattrs;
 
-    if (!_PyArg_NoKeywords("attrgetter", kw))
+    if (kw != NULL && !_PyArg_NoKeywords("attrgetter", kw))
         return NULL;
     if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
         return NULL;
@@ -992,7 +992,7 @@
 {
     PyObject *method, *obj, *result;
 
-    if (!_PyArg_NoKeywords("methodcaller", kw))
+    if (kw != NULL && !_PyArg_NoKeywords("methodcaller", kw))
         return NULL;
     if (!PyArg_UnpackTuple(args, "methodcaller", 1, 1, &obj))
         return NULL;

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list