Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Jun 18, 2025

The returned reference is :term:`borrowed <borrowed reference>` from *type*,
and will be valid as long as you hold a reference to *type*.
Do not release it with :c:func:`Py_DECREF` or similar.
Copy link
Contributor

@neonene neonene Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer L287 to have "otherwise" or something if hold a reference implies a Py_INCREF() in the previous line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I completely misread that, mixing the module and the type. LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. Thanks for checking!

@encukou encukou merged commit 140731f into python:main Jun 19, 2025
43 checks passed
@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jun 19, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2025
@bedevere-app
Copy link

bedevere-app bot commented Jun 19, 2025

GH-135701 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 19, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2025
@bedevere-app
Copy link

bedevere-app bot commented Jun 19, 2025

GH-135702 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 19, 2025
@encukou encukou deleted the getmodule-borrowed branch June 19, 2025 07:17
encukou added a commit that referenced this pull request Jun 19, 2025
encukou added a commit that referenced this pull request Jun 19, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants