summaryrefslogtreecommitdiffstats
path: root/Modules/_functoolsmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-12-16 14:18:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-12-16 14:18:57 (GMT)
commit5ab81d787f455ba28367b5b71606cea376283574 (patch)
treee78623a175940cb3d25d950812d0079021b178b7 /Modules/_functoolsmodule.c
parent1d59a0aacf1ddd000b6c6e231cf82ddf74afe3b4 (diff)
downloadcpython-5ab81d787f455ba28367b5b71606cea376283574.zip
cpython-5ab81d787f455ba28367b5b71606cea376283574.tar.gz
cpython-5ab81d787f455ba28367b5b71606cea376283574.tar.bz2
Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of dict.
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r--Modules/_functoolsmodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 19ca65b..6b5c008 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -84,7 +84,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
Py_DECREF(nargs);
- if (pkw == NULL || PyDict_Size(pkw) == 0) {
+ if (pkw == NULL || PyDict_GET_SIZE(pkw) == 0) {
if (kw == NULL) {
pto->kw = PyDict_New();
}
@@ -155,7 +155,7 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kw)
assert(PyTuple_Check(argappl));
}
- if (PyDict_Size(pto->kw) == 0) {
+ if (PyDict_GET_SIZE(pto->kw) == 0) {
kwappl = kw;
Py_XINCREF(kwappl);
}
@@ -713,7 +713,7 @@ lru_cache_make_key(PyObject *args, PyObject *kwds, int typed)
return args;
}
- if (kwds && PyDict_Size(kwds) > 0) {
+ if (kwds && PyDict_GET_SIZE(kwds) > 0) {
sorted_items = PyDict_Items(kwds);
if (!sorted_items)
return NULL;
@@ -933,7 +933,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds
}
lru_cache_append_link(self, link);
Py_INCREF(result); /* for return */
- self->full = (PyDict_Size(self->cache) >= self->maxsize);
+ self->full = (PyDict_GET_SIZE(self->cache) >= self->maxsize);
}
self->misses++;
return result;
@@ -1062,7 +1062,7 @@ lru_cache_cache_info(lru_cache_object *self, PyObject *unused)
{
return PyObject_CallFunction(self->cache_info_type, "nnOn",
self->hits, self->misses, self->maxsize_O,
- PyDict_Size(self->cache));
+ PyDict_GET_SIZE(self->cache));
}
static PyObject *