[Python-checkins] CVS: python/dist/src/Include object.h,2.48,2.49

Guido van Rossum guido@cnri.reston.va.us
Mon, 28 Feb 2000 10:00:43 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Include
In directory eric:/projects/python/develop/guido/src/Include

Modified Files:
	object.h 
Log Message:
Patch by Mozhe Zadka, for __contains__ (overloading 'in').  This adds
a new proc type (objobjproc), a new slot sq_contains to
PySequenceMethods, and a new flag Py_TPFLAGS_HAVE_SEQUENCE_IN to
Py_TPFLAGS_DEFAULT.  More to follow.


Index: object.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Include/object.h,v
retrieving revision 2.48
retrieving revision 2.49
diff -C2 -r2.48 -r2.49
*** object.h	2000/01/20 22:32:45	2.48
--- object.h	2000/02/28 15:00:40	2.49
***************
*** 151,154 ****
--- 151,155 ----
  typedef int (*getsegcountproc) Py_PROTO((PyObject *, int *));
  typedef int (*getcharbufferproc) Py_PROTO((PyObject *, int, const char **));
+ typedef int (*objobjproc) Py_PROTO((PyObject *, PyObject *));
  
  typedef struct {
***************
*** 186,189 ****
--- 187,191 ----
  	intobjargproc sq_ass_item;
  	intintobjargproc sq_ass_slice;
+ 	objobjproc sq_contains;
  } PySequenceMethods;
  
***************
*** 318,322 ****
  #define Py_TPFLAGS_HAVE_GETCHARBUFFER  (1L<<0)
  
! #define Py_TPFLAGS_DEFAULT  (Py_TPFLAGS_HAVE_GETCHARBUFFER)
  
  #define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)
--- 320,328 ----
  #define Py_TPFLAGS_HAVE_GETCHARBUFFER  (1L<<0)
  
! /* PySequenceMethods contains sq_contains */
! #define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1)
! 
! #define Py_TPFLAGS_DEFAULT  (Py_TPFLAGS_HAVE_GETCHARBUFFER | \
!                              Py_TPFLAGS_HAVE_SEQUENCE_IN)
  
  #define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)