Staging
v0.5.1
https://github.com/python/cpython
Revision fc45cb4400409572f05c8b54f2c6f06cbefb1b4e authored by Miss Islington (bot) on 22 April 2020, 19:05:10 UTC, committed by GitHub on 22 April 2020, 19:05:10 UTC

Because some people subclass this class and call undocumented methods, and we don't want to break them.
(cherry picked from commit 39652cd8bdf7c82b7c6055089a4ed90ee546a448)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
1 parent 4a6da0b
Raw File
Tip revision: fc45cb4400409572f05c8b54f2c6f06cbefb1b4e authored by Miss Islington (bot) on 22 April 2020, 19:05:10 UTC
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
Tip revision: fc45cb4
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