Skip to content

[3.14] gh-62534: Document that three-argument type() does not call __prepare__ (GH-154028)#154166

Open
miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-5625b18-3.14
Open

[3.14] gh-62534: Document that three-argument type() does not call __prepare__ (GH-154028)#154166
miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-5625b18-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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.
(cherry picked from commit 5625b18)

Co-authored-by: soreavis 263610811+soreavis@users.noreply.github.com

…repare__ (pythonGH-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.
(cherry picked from commit 5625b18)

Co-authored-by: soreavis <263610811+soreavis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants