FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Issue #11135: Remove redundant doc field from PyType_Spec. · pythoncapi/cpython@6916806 · GitHub

forked from python/cpython

Commit 6916806

Browse files
committed
Issue python#11135: Remove redundant doc field from PyType_Spec.
Reviewed by Georg Brandl.
1 parent dafdd7f commit 6916806

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎Include/object.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ typedef struct{
396396

397397
typedef struct{
398398
const char* name;
399-
const char* doc;
400399
int basicsize;
401400
int itemsize;
402401
int flags;

‎Misc/NEWS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ What's New in Python 3.2?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #11135: Remove redundant doc field from PyType_Spec.
14+
1315
- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
1416
in the limited ABI.
1517

‎Modules/xxlimited.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Xxo_setattr(XxoObject *self, char *name, PyObject *v)
101101
}
102102

103103
static PyType_Slot Xxo_Type_slots[] = {
104+
{Py_tp_doc, "The Xxo type"},
104105
{Py_tp_dealloc, Xxo_dealloc},
105106
{Py_tp_getattro, Xxo_getattro},
106107
{Py_tp_setattr, Xxo_setattr},
@@ -109,8 +110,7 @@ static PyType_Slot Xxo_Type_slots[] = {
109110
};
110111

111112
static PyType_Spec Xxo_Type_spec = {
112-
"xxmodule.Xxo",
113-
NULL,
113+
"xxlimited.Xxo",
114114
sizeof(XxoObject),
115115
0,
116116
Py_TPFLAGS_DEFAULT,
@@ -178,7 +178,6 @@ static PyType_Spec Str_Type_spec = {
178178
"xxlimited.Str",
179179
0,
180180
0,
181-
0,
182181
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
183182
Str_Type_slots
184183
};
@@ -201,7 +200,6 @@ static PyType_Slot Null_Type_slots[] = {
201200

202201
static PyType_Spec Null_Type_spec = {
203202
"xxlimited.Null",
204-
NULL, /* doc */
205203
0, /* basicsize */
206204
0, /* itemsize */
207205
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
@@ -230,7 +228,7 @@ PyDoc_STRVAR(module_doc,
230228

231229
static struct PyModuleDef xxmodule = {
232230
PyModuleDef_HEAD_INIT,
233-
"xx",
231+
"xxlimited",
234232
module_doc,
235233
-1,
236234
xx_methods,
@@ -264,7 +262,7 @@ PyInit_xxlimited(void)
264262

265263
/* Add some symbolic constants to the module */
266264
if (ErrorObject == NULL) {
267-
ErrorObject = PyErr_NewException("xx.error", NULL, NULL);
265+
ErrorObject = PyErr_NewException("xxlimited.error", NULL, NULL);
268266
if (ErrorObject == NULL)
269267
goto fail;
270268
}

‎Tools/scripts/abitype.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def make_slots(name, fields):
162162
res = []
163163
res.append('static PyType_Slot %s_slots[] = {' % name)
164164
# defaults for spec
165-
spec = { 'tp_doc':'NULL', 'tp_itemsize':'0' }
165+
spec = { 'tp_itemsize':'0' }
166166
for i, val in enumerate(fields):
167167
if val.endswith('0'):
168168
continue
@@ -174,7 +174,6 @@ def make_slots(name, fields):
174174
res.append('};')
175175
res.append('static PyType_Spec %s_spec = {' % name)
176176
res.append(' %s,' % spec['tp_name'])
177-
res.append(' %s,' % spec['tp_doc'])
178177
res.append(' %s,' % spec['tp_basicsize'])
179178
res.append(' %s,' % spec['tp_itemsize'])
180179
res.append(' %s,' % spec['tp_flags'])

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL