[Python-checkins] CVS: python/dist/src/Include descrobject.h,1.1.2.1,1.1.2.2 object.h,2.79.2.1,2.79.2.2

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 27 Apr 2001 11:04:52 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv25251/Include

Modified Files:
      Tag: descr-branch
	descrobject.h object.h 
Log Message:
Make the descriptor operations (formerly PyDescr_Get() and
PyDescr_Set()) slots in the type object.

Also, the choice to use tp_dict is made by placing a standard function
on the tp_[gs]etattro slot, not by default in PyObject_[GS]etAttr().



Index: descrobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Attic/descrobject.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** descrobject.h	2001/04/24 00:49:08	1.1.2.1
--- descrobject.h	2001/04/27 18:04:50	1.1.2.2
***************
*** 23,28 ****
  					       struct getsetlist *);
  
- extern DL_IMPORT(PyObject *) PyDescr_Get(PyObject *, PyObject *);
- extern DL_IMPORT(int) PyDescr_Set(PyObject *, PyObject *, PyObject *);
- 
  extern DL_IMPORT(int) PyType_InitDict(PyTypeObject *);
--- 23,25 ----

Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.79.2.1
retrieving revision 2.79.2.2
diff -C2 -r2.79.2.1 -r2.79.2.2
*** object.h	2001/04/24 00:49:08	2.79.2.1
--- object.h	2001/04/27 18:04:50	2.79.2.2
***************
*** 203,206 ****
--- 203,208 ----
  typedef PyObject *(*getiterfunc) (PyObject *);
  typedef PyObject *(*iternextfunc) (PyObject *);
+ typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *);
+ typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);
  
  typedef struct _typeobject {
***************
*** 262,265 ****
--- 264,269 ----
  	struct _typeobject *tp_base;
  	PyObject *tp_dict;
+ 	descrgetfunc tp_descr_get;
+ 	descrsetfunc tp_descr_set;
  
  #ifdef COUNT_ALLOCS
***************
*** 291,294 ****
--- 295,300 ----
  extern DL_IMPORT(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
  extern DL_IMPORT(int) PyObject_HasAttr(PyObject *, PyObject *);
+ extern DL_IMPORT(PyObject *) PyGeneric_GetAttr(PyObject *, PyObject *);
+ extern DL_IMPORT(int) PyGeneric_SetAttr(PyObject *, PyObject *, PyObject *);
  extern DL_IMPORT(long) PyObject_Hash(PyObject *);
  extern DL_IMPORT(int) PyObject_IsTrue(PyObject *);