diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-07 20:54:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-07 20:54:01 (GMT) |
commit | ccabcd4bd441416c276a4755a601fd3fc290e32a (patch) | |
tree | 50bdd991d26052c512eeb216e5e4c1d04ae2f8e5 /Include | |
parent | a9800a8d5b55d43df36d26f6e15709781c0d00aa (diff) | |
download | cpython-ccabcd4bd441416c276a4755a601fd3fc290e32a.zip cpython-ccabcd4bd441416c276a4755a601fd3fc290e32a.tar.gz cpython-ccabcd4bd441416c276a4755a601fd3fc290e32a.tar.bz2 |
make struct sequences subclass tuple; kill lots of code
This fixes #8413.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/structseq.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Include/structseq.h b/Include/structseq.h index 0b8d387..25763ce 100644 --- a/Include/structseq.h +++ b/Include/structseq.h @@ -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 |