[Python-checkins] python/dist/src/Doc/api concrete.tex,1.32,1.33

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Nov 25 16:12:16 EST 2003


Update of /cvsroot/python/python/dist/src/Doc/api
In directory sc8-pr-cvs1:/tmp/cvs-serv24958/Doc/API

Modified Files:
	concrete.tex 
Log Message:
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.



Index: concrete.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** concrete.tex	10 Nov 2003 14:48:48 -0000	1.32
--- concrete.tex	25 Nov 2003 21:12:14 -0000	1.33
***************
*** 1809,1812 ****
--- 1809,1820 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{int}{PyDict_Contains}{PyObject *p, PyObject *key}
+   Determine if dictionary \var{p} contains \var{key}.  If an item
+   in \var{p} is matches \var{key}, return \code{1}, otherwise return
+   \code{0}.  On error, return \code{-1}.  This is equivalent to the
+   Python expression \samp{\var{key} in \var{p}}.
+   \versionadded{2.4}			 
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{PyObject*}{PyDict_Copy}{PyObject *p}
    Returns a new dictionary that contains the same key-value pairs as





More information about the Python-checkins mailing list