Martin von Löwis avatar Martin von Löwis committed 20d8287

Issue #11135: Remove redundant doc field from PyType_Spec.
Reviewed by Georg Brandl.

Comments (0)

Files changed (4)

 
 typedef struct{
     const char* name;
-    const char* doc;
     int basicsize;
     int itemsize;
     int flags;
 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.
 

Modules/xxlimited.c

 }
 
 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},
 };
 
 static PyType_Spec Xxo_Type_spec = {
-    "xxmodule.Xxo",
-    NULL,
+    "xxlimited.Xxo",
     sizeof(XxoObject),
     0,
     Py_TPFLAGS_DEFAULT,
     "xxlimited.Str",
     0,
     0,
-    0,
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     Str_Type_slots
 };
 
 static PyType_Spec Null_Type_spec = {
     "xxlimited.Null",
-    NULL,            /* doc */
     0,               /* basicsize */
     0,               /* itemsize */
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
 
 static struct PyModuleDef xxmodule = {
     PyModuleDef_HEAD_INIT,
-    "xx",
+    "xxlimited",
     module_doc,
     -1,
     xx_methods,
 
     /* 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;
     }

Tools/scripts/abitype.py

     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
     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'])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.