diff options
author | Raymond Hettinger <python@rcn.com> | 2003-11-25 21:12:14 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-11-25 21:12:14 (GMT) |
commit | bc0f2ab9bbe1380a32cc63823258a337a525fb32 (patch) | |
tree | 4e0f76ebe43b74cab10b1e6bd41b1d90fe6f8230 /Include | |
parent | 3972457de72fa6d95d94df14a3bb402798aa092c (diff) | |
download | cpython-bc0f2ab9bbe1380a32cc63823258a337a525fb32.zip cpython-bc0f2ab9bbe1380a32cc63823258a337a525fb32.tar.gz cpython-bc0f2ab9bbe1380a32cc63823258a337a525fb32.tar.bz2 |
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')
-rw-r--r-- | Include/dictobject.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h index c8ae912..554b82e 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); |