Skip to content

[3.15] gh-152692: Fix annotationlib.type_repr() for bound built-in methods (GH-152693) - #159280

Merged
encukou merged 1 commit into
python:3.15from
miss-islington:backport-6979003-3.15
Oct 13, 2026
Merged

encukou merged 1 commit into
python:3.15from
miss-islington:backport-6979003-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

type_repr() returned a string naming a nonexistent module None -- e.g.
type_repr([].append) == 'None.list.append' -- for bound built-in methods,
whose module is None.

Return the qualified name when module is None, as already done for the
"builtins" module.
(cherry picked from commit 6979003)

Co-authored-by: tonghuaroot (童话) tonghuaroot@gmail.com

…hods (pythonGH-152693)

type_repr() returned a string naming a nonexistent module None -- e.g.
type_repr([].append) == 'None.list.append' -- for bound built-in methods,
whose __module__ is None.

Return the qualified name when __module__ is None, as already done for the
"builtins" module.
(cherry picked from commit 6979003)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
@encukou
encukou merged commit ed86174 into python:3.15 Oct 13, 2026
56 checks passed
@miss-islington
miss-islington deleted the backport-6979003-3.15 branch October 13, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants