Staging
v0.5.1
https://github.com/python/cpython
Revision ddb536ba7b7c6022424e39d666c3cc81772645c0 authored by Serhiy Storchaka on 08 September 2017, 07:43:54 UTC, committed by GitHub on 08 September 2017, 07:43:54 UTC
(cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
1 parent 9f2b3d4
Raw File
Tip revision: ddb536ba7b7c6022424e39d666c3cc81772645c0 authored by Serhiy Storchaka on 08 September 2017, 07:43:54 UTC
[3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)
Tip revision: ddb536b
cellobject.h
/* Cell object interface */
#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	PyObject_HEAD
	PyObject *ob_ref;	/* Content of the cell or NULL when empty */
} PyCellObject;

PyAPI_DATA(PyTypeObject) PyCell_Type;

#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)

PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
PyAPI_FUNC(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 */
#endif /* Py_LIMITED_API */
back to top