mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
gh-117764: Add docstrings and signatures for the types of None, Ellipsis and NotImplemented (GH-117813)
This commit is contained in:
parent
39a6b29756
commit
2d3d9b4461
4 changed files with 21 additions and 6 deletions
|
|
@ -2007,6 +2007,11 @@ static PyNumberMethods none_as_number = {
|
|||
0, /* nb_index */
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(none_doc,
|
||||
"NoneType()\n"
|
||||
"--\n\n"
|
||||
"The type of the None singleton.");
|
||||
|
||||
PyTypeObject _PyNone_Type = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
"NoneType",
|
||||
|
|
@ -2028,7 +2033,7 @@ PyTypeObject _PyNone_Type = {
|
|||
0, /*tp_setattro */
|
||||
0, /*tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /*tp_flags */
|
||||
0, /*tp_doc */
|
||||
none_doc, /*tp_doc */
|
||||
0, /*tp_traverse */
|
||||
0, /*tp_clear */
|
||||
_Py_BaseObject_RichCompare, /*tp_richcompare */
|
||||
|
|
@ -2106,6 +2111,11 @@ static PyNumberMethods notimplemented_as_number = {
|
|||
.nb_bool = notimplemented_bool,
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(notimplemented_doc,
|
||||
"NotImplementedType()\n"
|
||||
"--\n\n"
|
||||
"The type of the NotImplemented singleton.");
|
||||
|
||||
PyTypeObject _PyNotImplemented_Type = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
"NotImplementedType",
|
||||
|
|
@ -2127,7 +2137,7 @@ PyTypeObject _PyNotImplemented_Type = {
|
|||
0, /*tp_setattro */
|
||||
0, /*tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /*tp_flags */
|
||||
0, /*tp_doc */
|
||||
notimplemented_doc, /*tp_doc */
|
||||
0, /*tp_traverse */
|
||||
0, /*tp_clear */
|
||||
0, /*tp_richcompare */
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ static PyMethodDef ellipsis_methods[] = {
|
|||
{NULL, NULL}
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(ellipsis_doc,
|
||||
"ellipsis()\n"
|
||||
"--\n\n"
|
||||
"The type of the Ellipsis singleton.");
|
||||
|
||||
PyTypeObject PyEllipsis_Type = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
"ellipsis", /* tp_name */
|
||||
|
|
@ -78,7 +83,7 @@ PyTypeObject PyEllipsis_Type = {
|
|||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
0, /* tp_doc */
|
||||
ellipsis_doc, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue