[Python-checkins] CVS: python/dist/src/Include cellobject.h,NONE,2.1 Python.h,2.30,2.31

Jeremy Hylton jhylton@users.sourceforge.net
Thu, 25 Jan 2001 12:04:16 -0800


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

Modified Files:
	Python.h 
Added Files:
	cellobject.h 
Log Message:
PEP 227 implementation

A cell contains a reference to a single PyObject.  It could be
implemented as a mutable, one-element sequence, but the separate type
has less overhead.



--- NEW FILE: cellobject.h ---
/* Cell object interface */

#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	PyObject_VAR_HEAD
	PyObject *ob_ref;
} PyCellObject;

extern DL_IMPORT(PyTypeObject) PyCell_Type;

#define PyCell_Check(op) ((op)->ob_type == &PyCell_Type)

extern DL_IMPORT(PyObject *) PyCell_New(PyObject *);
extern DL_IMPORT(PyObject *) PyCell_Get(PyObject *);
extern DL_IMPORT(int) PyCell_Set(PyObject *, PyObject *);

#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)

#ifdef __cplusplus
}
#endif
#endif /* !Py_TUPLEOBJECT_H */

Index: Python.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -r2.30 -r2.31
*** Python.h	2000/09/26 05:45:59	2.30
--- Python.h	2001/01/25 20:04:14	2.31
***************
*** 82,85 ****
--- 82,86 ----
  #include "traceback.h"
  #include "sliceobject.h"
+ #include "cellobject.h"
  
  #include "codecs.h"