Skip to content

gh-144629: Add test for the PyFunction_GetAnnotations function#144630

Merged
vstinner merged 1 commit intopython:mainfrom
nybblista:test-pyfunc-anno
Feb 10, 2026
Merged

gh-144629: Add test for the PyFunction_GetAnnotations function#144630
vstinner merged 1 commit intopython:mainfrom
nybblista:test-pyfunc-anno

Conversation

@nybblista
Copy link
Contributor

@nybblista nybblista commented Feb 9, 2026

Add test for the PyFunction_GetAnnotations function.

@nybblista
Copy link
Contributor Author

@vstinner

@nybblista
Copy link
Contributor Author

The other test functions in the function.c file use the same else style, so I kept it for consistency.

@ZeroIntensity ZeroIntensity added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes tests Tests in the Lib/test dir labels Feb 10, 2026
@nybblista
Copy link
Contributor Author

💯 I agree with @ZeroIntensity. However, I think it would be a good idea to apply the same approach to function_get_code, function_get_globals, and function_get_module.

@vstinner
Copy link
Member

However, I think it would be a good idea to apply the same approach to function_get_code, function_get_globals, and function_get_module.

I don't think that it's worth it to modify existing functions, it would only be a coding style change.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner enabled auto-merge (squash) February 10, 2026 14:11
@vstinner vstinner merged commit cc81707 into python:main Feb 10, 2026
85 of 87 checks passed
@miss-islington-app
Copy link

Thanks @nybblista for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 10, 2026
pythonGH-144630)

(cherry picked from commit cc81707)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @nybblista and @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cc81707e406c49c63afc18048e1a221d796ce638 3.13

@bedevere-app
Copy link

bedevere-app bot commented Feb 10, 2026

GH-144670 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 Feb 10, 2026
@vstinner vstinner removed the needs backport to 3.13 bugs and security fixes label Feb 10, 2026
@vstinner
Copy link
Member

vstinner removed the needs backport to 3.13 label

3.13 branch lacks Modules/_testcapi/function.c file. I'm not interested to backport it.

@vstinner
Copy link
Member

Merged, thanks.

@nybblista nybblista deleted the test-pyfunc-anno branch February 10, 2026 14:50
vstinner pushed a commit that referenced this pull request Feb 10, 2026
…on (GH-144630) (#144670)

gh-144629: Add test for the PyFunction_GetAnnotations() function (GH-144630)
(cherry picked from commit cc81707)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants