mirror of
https://github.com/python/cpython.git
synced 2025-09-15 05:06:12 +00:00
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
This commit is contained in:
parent
b1994b4a5d
commit
6819210b9e
129 changed files with 1090 additions and 1250 deletions
|
@ -514,8 +514,7 @@ O_dealloc(Oobject *self) {
|
|||
PyDoc_STRVAR(Otype__doc__, "Simple type for output to strings.");
|
||||
|
||||
static PyTypeObject Otype = {
|
||||
PyObject_HEAD_INIT(NULL)
|
||||
0, /*ob_size*/
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"cStringIO.StringO", /*tp_name*/
|
||||
sizeof(Oobject), /*tp_basicsize*/
|
||||
0, /*tp_itemsize*/
|
||||
|
@ -635,8 +634,7 @@ PyDoc_STRVAR(Itype__doc__,
|
|||
"Simple type for treating strings as input file streams");
|
||||
|
||||
static PyTypeObject Itype = {
|
||||
PyObject_HEAD_INIT(NULL)
|
||||
0, /*ob_size*/
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"cStringIO.StringI", /*tp_name*/
|
||||
sizeof(Iobject), /*tp_basicsize*/
|
||||
0, /*tp_itemsize*/
|
||||
|
@ -746,8 +744,8 @@ initcStringIO(void) {
|
|||
d = PyModule_GetDict(m);
|
||||
|
||||
/* Export C API */
|
||||
Itype.ob_type=&PyType_Type;
|
||||
Otype.ob_type=&PyType_Type;
|
||||
Py_Type(&Itype)=&PyType_Type;
|
||||
Py_Type(&Otype)=&PyType_Type;
|
||||
if (PyType_Ready(&Otype) < 0) return;
|
||||
if (PyType_Ready(&Itype) < 0) return;
|
||||
PyDict_SetItemString(d,"cStringIO_CAPI",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue