[Python-checkins] bpo-45392: Update the docstring of the 'type' built-in (GH-29439)

ambv webhook-mailer at python.org
Sat Nov 6 15:08:52 EDT 2021


https://github.com/python/cpython/commit/91275207296c39e495fe118019a757c4ddefede8
commit: 91275207296c39e495fe118019a757c4ddefede8
branch: main
author: Mark Dickinson <mdickinson at enthought.com>
committer: ambv <lukasz at langa.pl>
date: 2021-11-06T20:08:44+01:00
summary:

bpo-45392: Update the docstring of the 'type' built-in (GH-29439)

files:
A Misc/NEWS.d/next/Documentation/2021-11-06-10-54-17.bpo-45392.JZnVOz.rst
M Objects/typeobject.c

diff --git a/Misc/NEWS.d/next/Documentation/2021-11-06-10-54-17.bpo-45392.JZnVOz.rst b/Misc/NEWS.d/next/Documentation/2021-11-06-10-54-17.bpo-45392.JZnVOz.rst
new file mode 100644
index 0000000000000..09c16578ff478
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2021-11-06-10-54-17.bpo-45392.JZnVOz.rst
@@ -0,0 +1,2 @@
+Update the docstring of the :class:`type` built-in to remove a redundant
+line and to mention keyword arguments for the constructor.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 51ec93d875271..4180a9d13c45f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4268,10 +4268,8 @@ static PyMethodDef type_methods[] = {
 };
 
 PyDoc_STRVAR(type_doc,
-/* this text signature cannot be accurate yet.  will fix.  --larry */
-"type(object_or_name, bases, dict)\n"
 "type(object) -> the object's type\n"
-"type(name, bases, dict) -> a new type");
+"type(name, bases, dict, **kwds) -> a new type");
 
 static int
 type_traverse(PyTypeObject *type, visitproc visit, void *arg)



More information about the Python-checkins mailing list