summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-11-25 21:12:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-11-25 21:12:14 (GMT)
commitbc0f2ab9bbe1380a32cc63823258a337a525fb32 (patch)
tree4e0f76ebe43b74cab10b1e6bd41b1d90fe6f8230 /Misc
parent3972457de72fa6d95d94df14a3bb402798aa092c (diff)
downloadcpython-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 'Misc')
-rw-r--r--Misc/NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index f7b1e96..a3f3a18 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -231,6 +231,10 @@ Build
C API
-----
+- Added a new function, PyDict_Contains(d, k) which is like
+ PySequence_Contains() but is specific to dictionaries and executes
+ about 10% faster.
+
- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
Each return the singleton they mention after Py_INCREF()ing them.