mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merge branches/pep-0384.
This commit is contained in:
parent
c4df784514
commit
4d0d471a80
102 changed files with 2835 additions and 75 deletions
|
@ -21,6 +21,7 @@ inserted in the tuple. Similarly, PyTuple_GetItem does not increment the
|
|||
returned item's reference count.
|
||||
*/
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
typedef struct {
|
||||
PyObject_VAR_HEAD
|
||||
PyObject *ob_item[1];
|
||||
|
@ -30,6 +31,7 @@ typedef struct {
|
|||
* the tuple is not yet visible outside the function that builds it.
|
||||
*/
|
||||
} PyTupleObject;
|
||||
#endif
|
||||
|
||||
PyAPI_DATA(PyTypeObject) PyTuple_Type;
|
||||
PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
|
||||
|
@ -43,16 +45,22 @@ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
|
|||
PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
|
||||
PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
|
||||
#endif
|
||||
PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
|
||||
#endif
|
||||
|
||||
/* Macro, trading safety for speed */
|
||||
#ifndef Py_LIMITED_API
|
||||
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
|
||||
#define PyTuple_GET_SIZE(op) Py_SIZE(op)
|
||||
|
||||
/* Macro, *only* to be used to fill in brand new tuples */
|
||||
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) PyTuple_ClearFreeList(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue