mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
make struct sequences subclass tuple; kill lots of code
This fixes #8413.
This commit is contained in:
parent
a9800a8d5b
commit
ccabcd4bd4
3 changed files with 23 additions and 215 deletions
|
|
@ -26,17 +26,12 @@ PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
|
|||
|
||||
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
|
||||
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
PyObject *ob_item[1];
|
||||
} PyStructSequence;
|
||||
typedef PyTupleObject PyStructSequence;
|
||||
|
||||
/* Macro, *only* to be used to fill in brand new objects */
|
||||
#define PyStructSequence_SET_ITEM(op, i, v) \
|
||||
(((PyStructSequence *)(op))->ob_item[i] = v)
|
||||
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
|
||||
|
||||
#define PyStructSequence_GET_ITEM(op, i) \
|
||||
(((PyStructSequence *)(op))->ob_item[i])
|
||||
#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue