summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/clinic/descrobject.c.h8
-rw-r--r--Objects/descrobject.c9
-rw-r--r--Objects/genericaliasobject.c2
-rw-r--r--Objects/memoryobject.c5
-rw-r--r--Objects/namespaceobject.c6
-rw-r--r--Objects/rangeobject.c2
-rw-r--r--Objects/typeobject.c9
7 files changed, 28 insertions, 13 deletions
diff --git a/Objects/clinic/descrobject.c.h b/Objects/clinic/descrobject.c.h
index 02fb440..d79be80 100644
--- a/Objects/clinic/descrobject.c.h
+++ b/Objects/clinic/descrobject.c.h
@@ -8,6 +8,12 @@ preserve
#endif
#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
+PyDoc_STRVAR(mappingproxy_new__doc__,
+"mappingproxy(mapping)\n"
+"--\n"
+"\n"
+"Read-only proxy of a mapping.");
+
static PyObject *
mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping);
@@ -167,4 +173,4 @@ skip_optional_pos:
exit:
return return_value;
}
-/*[clinic end generated code: output=a4664ccf3da10f5a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=050e331316a04207 input=a9049054013a1b77]*/
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 3423f15..029318f 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1165,8 +1165,8 @@ mappingproxy_reversed(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyMethodDef mappingproxy_methods[] = {
{"get", _PyCFunction_CAST(mappingproxy_get), METH_FASTCALL,
- PyDoc_STR("D.get(k[,d]) -> D[k] if k in D, else d."
- " d defaults to None.")},
+ PyDoc_STR("get($self, key, default=None, /)\n--\n\n"
+ "Return the value for key if key is in the mapping, else default.")},
{"keys", mappingproxy_keys, METH_NOARGS,
PyDoc_STR("D.keys() -> a set-like object providing a view on D's keys")},
{"values", mappingproxy_values, METH_NOARGS,
@@ -1254,11 +1254,12 @@ mappingproxy.__new__ as mappingproxy_new
mapping: object
+Read-only proxy of a mapping.
[clinic start generated code]*/
static PyObject *
mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping)
-/*[clinic end generated code: output=65f27f02d5b68fa7 input=d2d620d4f598d4f8]*/
+/*[clinic end generated code: output=65f27f02d5b68fa7 input=c156df096ef7590c]*/
{
mappingproxyobject *mappingproxy;
@@ -2024,7 +2025,7 @@ PyTypeObject PyDictProxy_Type = {
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_MAPPING, /* tp_flags */
- 0, /* tp_doc */
+ mappingproxy_new__doc__, /* tp_doc */
mappingproxy_traverse, /* tp_traverse */
0, /* tp_clear */
mappingproxy_richcompare, /* tp_richcompare */
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index c045d49..2779baf 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -537,6 +537,8 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
}
PyDoc_STRVAR(genericalias__doc__,
+"GenericAlias(origin, args, /)\n"
+"--\n\n"
"Represent a PEP 585 generic type\n"
"\n"
"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).");
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 6a38952..5caa650 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -3255,6 +3255,9 @@ PyDoc_STRVAR(memory_f_contiguous_doc,
"A bool indicating whether the memory is Fortran contiguous.");
PyDoc_STRVAR(memory_contiguous_doc,
"A bool indicating whether the memory is contiguous.");
+PyDoc_STRVAR(memory_exit_doc,
+ "__exit__($self, /, *exc_info)\n--\n\n"
+ "Release the underlying buffer exposed by the memoryview object.");
static PyGetSetDef memory_getsetlist[] = {
@@ -3283,7 +3286,7 @@ static PyMethodDef memory_methods[] = {
MEMORYVIEW_TOREADONLY_METHODDEF
MEMORYVIEW__FROM_FLAGS_METHODDEF
{"__enter__", memory_enter, METH_NOARGS, NULL},
- {"__exit__", memory_exit, METH_VARARGS, NULL},
+ {"__exit__", memory_exit, METH_VARARGS, memory_exit_doc},
{NULL, NULL}
};
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c
index a6b02fd..b2a224b 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -227,9 +227,9 @@ static PyMethodDef namespace_methods[] = {
PyDoc_STRVAR(namespace_doc,
-"A simple attribute-based namespace.\n\
-\n\
-SimpleNamespace(**kwargs)");
+"SimpleNamespace(**kwargs)\n\
+--\n\n\
+A simple attribute-based namespace.");
PyTypeObject _PyNamespace_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index ce9eef6..7da6162 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -751,7 +751,7 @@ PyDoc_STRVAR(index_doc,
static PyMethodDef range_methods[] = {
{"__reversed__", range_reverse, METH_NOARGS, reverse_doc},
- {"__reduce__", (PyCFunction)range_reduce, METH_VARARGS},
+ {"__reduce__", (PyCFunction)range_reduce, METH_NOARGS},
{"count", (PyCFunction)range_count, METH_O, count_doc},
{"index", (PyCFunction)range_index, METH_O, index_doc},
{NULL, NULL} /* sentinel */
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 3f38abf..ee0286e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6917,7 +6917,7 @@ static PyMethodDef object_methods[] = {
OBJECT___REDUCE_EX___METHODDEF
OBJECT___REDUCE___METHODDEF
OBJECT___GETSTATE___METHODDEF
- {"__subclasshook__", object_subclasshook, METH_CLASS | METH_VARARGS,
+ {"__subclasshook__", object_subclasshook, METH_CLASS | METH_O,
object_subclasshook_doc},
{"__init_subclass__", object_init_subclass, METH_CLASS | METH_NOARGS,
object_init_subclass_doc},
@@ -9893,7 +9893,8 @@ static pytype_slotdef slotdefs[] = {
TPSLOT(__getattribute__, tp_getattro, _Py_slot_tp_getattr_hook,
wrap_binaryfunc,
"__getattribute__($self, name, /)\n--\n\nReturn getattr(self, name)."),
- TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL, ""),
+ TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL,
+ "__getattr__($self, name, /)\n--\n\nImplement getattr(self, name)."),
TPSLOT(__setattr__, tp_setattro, slot_tp_setattro, wrap_setattr,
"__setattr__($self, name, value, /)\n--\n\nImplement setattr(self, name, value)."),
TPSLOT(__delattr__, tp_setattro, slot_tp_setattro, wrap_delattr,
@@ -9928,7 +9929,9 @@ static pytype_slotdef slotdefs[] = {
TPSLOT(__new__, tp_new, slot_tp_new, NULL,
"__new__(type, /, *args, **kwargs)\n--\n\n"
"Create and return new object. See help(type) for accurate signature."),
- TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del, ""),
+ TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del,
+ "__del__($self, /)\n--\n\n"
+ "Called when the instance is about to be destroyed."),
BUFSLOT(__buffer__, bf_getbuffer, slot_bf_getbuffer, wrap_buffer,
"__buffer__($self, flags, /)\n--\n\n"