summaryrefslogtreecommitdiff
path: root/Include/dictobject.h
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-11-25 21:12:14 +0000
committerRaymond Hettinger <python@rcn.com>2003-11-25 21:12:14 +0000
commitc6dd0031c4a6ebfeeb80d09145a8f0211725e556 (patch)
treed301d3f3e1c7e230e2e3eea4cd165a49e4f5e784 /Include/dictobject.h
parentaa7a6ea8b2f2408394a265975d73b3c04ecd744e (diff)
downloadcpython-c6dd0031c4a6ebfeeb80d09145a8f0211725e556.tar.gz
Expose dict_contains() and PyDict_Contains() with is about 10% faster
than PySequence_Contains() and more clearly applicable to dicts. Apply the new function in setobject.c where __contains__ checking is ubiquitous.
Diffstat (limited to 'Include/dictobject.h')
-rw-r--r--Include/dictobject.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h
index c8ae912733..554b82e5a3 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -100,6 +100,7 @@ PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
PyAPI_FUNC(int) PyDict_Size(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
+PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);