mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Merge branches/pep-0384.
This commit is contained in:
parent
c4df784514
commit
4d0d471a80
102 changed files with 2835 additions and 75 deletions
|
@ -43,6 +43,18 @@ PyStructSequence_New(PyTypeObject *type)
|
|||
return (PyObject*)obj;
|
||||
}
|
||||
|
||||
void
|
||||
PyStructSequence_SetItem(PyObject* op, Py_ssize_t i, PyObject* v)
|
||||
{
|
||||
PyStructSequence_SET_ITEM(op, i, v);
|
||||
}
|
||||
|
||||
PyObject*
|
||||
PyStructSequence_GetItem(PyObject* op, Py_ssize_t i)
|
||||
{
|
||||
return PyStructSequence_GET_ITEM(op, i);
|
||||
}
|
||||
|
||||
static void
|
||||
structseq_dealloc(PyStructSequence *obj)
|
||||
{
|
||||
|
@ -365,3 +377,11 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
|
|||
SET_DICT_FROM_INT(real_length_key, n_members);
|
||||
SET_DICT_FROM_INT(unnamed_fields_key, n_unnamed_members);
|
||||
}
|
||||
|
||||
PyTypeObject*
|
||||
PyStructSequence_NewType(PyStructSequence_Desc *desc)
|
||||
{
|
||||
PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
|
||||
PyStructSequence_InitType(result, desc);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue