]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-62534: Document that three-argument type() does not call __prepare__ (GH-154028)
authorsoreavis <263610811+soreavis@users.noreply.github.com>
Sun, 19 Jul 2026 15:31:59 +0000 (17:31 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 15:31:59 +0000 (17:31 +0200)
commit5625b187ab528e10dcaa21726a7c95b110d97190
tree543dfa2e999b1064e1f0bcd8c273b58cbe7e5220
parenteb447081ed8182f825fa01953ec87cff41f3d585
gh-62534: Document that three-argument type() does not call __prepare__ (GH-154028)

The three-argument form of type() skips the metaclass __prepare__
method, which is called by the class statement machinery rather than
by the metaclass call itself. Say so in the type() entry and point to
types.new_class() for dynamic class creation with the appropriate
metaclass, as directed in the issue thread.
Doc/library/functions.rst