From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 1 Apr 2021 00:10:36 +0000 (-0700) Subject: bpo-42840: Document providing kwargs to type. (GH-24173) X-Git-Tag: v3.9.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3c1e2c493e67f84b1034ac6c49492a459b0736d;p=thirdparty%2FPython%2Fcpython.git bpo-42840: Document providing kwargs to type. (GH-24173) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 72fcd14a82369ed32a5846d76f50e3026cf4eec2) Co-authored-by: Erik Soma --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 990fc10c8cc9..ef51782205b4 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1675,7 +1675,7 @@ are always available. They are listed here in alphabetical order. .. class:: type(object) - type(name, bases, dict) + type(name, bases, dict, **kwds) .. index:: object: type @@ -1704,6 +1704,13 @@ are always available. They are listed here in alphabetical order. See also :ref:`bltin-type-objects`. + Keyword arguments provided to the three argument form are passed to the + appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) + in the same way that keywords in a class + definition (besides *metaclass*) would. + + See also :ref:`class-customization`. + .. versionchanged:: 3.6 Subclasses of :class:`type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object.