summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-02-11 20:47:49 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-02-11 20:47:49 (GMT)
commit691680644351924a4c5d0bee445e52b1d7e0cf97 (patch)
treea6b499eb3bc5b45019558832a35e95a70b531908
parentdafdd7f8caf8e5fa4cceaade2c7e8c0076085dad (diff)
downloadcpython-691680644351924a4c5d0bee445e52b1d7e0cf97.zip
cpython-691680644351924a4c5d0bee445e52b1d7e0cf97.tar.gz
cpython-691680644351924a4c5d0bee445e52b1d7e0cf97.tar.bz2
Issue #11135: Remove redundant doc field from PyType_Spec.
Reviewed by Georg Brandl.
-rw-r--r--Include/object.h1
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/xxlimited.c10
-rw-r--r--Tools/scripts/abitype.py3
4 files changed, 7 insertions, 9 deletions
diff --git a/Include/object.h b/Include/object.h
index 99a7737..3753785 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -396,7 +396,6 @@ typedef struct{
typedef struct{
const char* name;
- const char* doc;
int basicsize;
int itemsize;
int flags;
diff --git a/Misc/NEWS b/Misc/NEWS
index 4a7e3a9..8e4ae14 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.2?
Core and Builtins
-----------------
+- Issue #11135: Remove redundant doc field from PyType_Spec.
+
- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI.
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c
index 5a6df8f..ec924f2 100644
--- a/Modules/xxlimited.c
+++ b/Modules/xxlimited.c
@@ -101,6 +101,7 @@ Xxo_setattr(XxoObject *self, char *name, PyObject *v)
}
static PyType_Slot Xxo_Type_slots[] = {
+ {Py_tp_doc, "The Xxo type"},
{Py_tp_dealloc, Xxo_dealloc},
{Py_tp_getattro, Xxo_getattro},
{Py_tp_setattr, Xxo_setattr},
@@ -109,8 +110,7 @@ static PyType_Slot Xxo_Type_slots[] = {
};
static PyType_Spec Xxo_Type_spec = {
- "xxmodule.Xxo",
- NULL,
+ "xxlimited.Xxo",
sizeof(XxoObject),
0,
Py_TPFLAGS_DEFAULT,
@@ -178,7 +178,6 @@ static PyType_Spec Str_Type_spec = {
"xxlimited.Str",
0,
0,
- 0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
Str_Type_slots
};
@@ -201,7 +200,6 @@ static PyType_Slot Null_Type_slots[] = {
static PyType_Spec Null_Type_spec = {
"xxlimited.Null",
- NULL, /* doc */
0, /* basicsize */
0, /* itemsize */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
@@ -230,7 +228,7 @@ PyDoc_STRVAR(module_doc,
static struct PyModuleDef xxmodule = {
PyModuleDef_HEAD_INIT,
- "xx",
+ "xxlimited",
module_doc,
-1,
xx_methods,
@@ -264,7 +262,7 @@ PyInit_xxlimited(void)
/* Add some symbolic constants to the module */
if (ErrorObject == NULL) {
- ErrorObject = PyErr_NewException("xx.error", NULL, NULL);
+ ErrorObject = PyErr_NewException("xxlimited.error", NULL, NULL);
if (ErrorObject == NULL)
goto fail;
}
diff --git a/Tools/scripts/abitype.py b/Tools/scripts/abitype.py
index afb104b..e35ef6a 100644
--- a/Tools/scripts/abitype.py
+++ b/Tools/scripts/abitype.py
@@ -162,7 +162,7 @@ def make_slots(name, fields):
res = []
res.append('static PyType_Slot %s_slots[] = {' % name)
# defaults for spec
- spec = { 'tp_doc':'NULL', 'tp_itemsize':'0' }
+ spec = { 'tp_itemsize':'0' }
for i, val in enumerate(fields):
if val.endswith('0'):
continue
@@ -174,7 +174,6 @@ def make_slots(name, fields):
res.append('};')
res.append('static PyType_Spec %s_spec = {' % name)
res.append(' %s,' % spec['tp_name'])
- res.append(' %s,' % spec['tp_doc'])
res.append(' %s,' % spec['tp_basicsize'])
res.append(' %s,' % spec['tp_itemsize'])
res.append(' %s,' % spec['tp_flags'])