Skip to content

Commit df0f7c4

Browse files
Change Struct's docstring & add test in test_inspect.py
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 905e545 commit df0f7c4

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Lib/test/test_inspect/test_inspect.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6266,6 +6266,10 @@ def test_stat_module_has_signatures(self):
62666266
import stat
62676267
self._test_module_has_signatures(stat)
62686268

6269+
def test_struct_module_has_signatures(self):
6270+
import struct
6271+
self._test_module_has_signatures(struct)
6272+
62696273
def test_string_module_has_signatures(self):
62706274
import string
62716275
self._test_module_has_signatures(string)

Modules/_struct.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,17 +2440,12 @@ static PyGetSetDef s_getsetlist[] = {
24402440
{NULL} /* sentinel */
24412441
};
24422442

2443-
PyDoc_STRVAR(s__doc__,
2444-
"Struct(fmt) --> compiled struct object\n"
2445-
"\n"
2446-
);
2447-
24482443
static PyType_Slot PyStructType_slots[] = {
24492444
{Py_tp_dealloc, s_dealloc},
24502445
{Py_tp_getattro, PyObject_GenericGetAttr},
24512446
{Py_tp_setattro, PyObject_GenericSetAttr},
24522447
{Py_tp_repr, s_repr},
2453-
{Py_tp_doc, (void*)s__doc__},
2448+
{Py_tp_doc, (void*)Struct___init____doc__},
24542449
{Py_tp_traverse, s_traverse},
24552450
{Py_tp_clear, s_clear},
24562451
{Py_tp_methods, s_methods},

0 commit comments

Comments
 (0)