Skip to content

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

Merged
encukou merged 1 commit into
python:3.15from
miss-islington:backport-5625b18-3.15
Jul 29, 2026
Merged

[3.15] gh-62534: Document that three-argument type() does not call __prepare__ (GH-154028)#154165
encukou merged 1 commit into
python:3.15from
miss-islington:backport-5625b18-3.15

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>
@read-the-docs-community

Copy link
Copy Markdown

@encukou
encukou merged commit 23bf108 into python:3.15 Jul 29, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 29, 2026
@miss-islington
miss-islington deleted the backport-5625b18-3.15 branch July 29, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants