Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensityZeroIntensity commented Jun 25, 2025

Comment on lines +150 to +152
This function cannot fail and does not do error checking; passing anything
other than an instance of :c:data:`PyFunction_Type` is undefined behavior.
There is no ``PyFunction_Get*`` equivalent for this function.
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I don't think C API WG would approve.
Should this function be in a private header (and with an underscore) instead? It looks untested as well.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It's sort of tested. I'm not opposed to making it private.

Copy link
Member

Choose a reason for hiding this comment

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

That looks like it's used in a test -- the test assumes that it's working?
Yeah, the more I look into it, the better making it private seems.

cc @ericsnowcurrently, who added PyFunction_GET_BUILTINS in #133128

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll put up an alternate PR.

Choose a reason for hiding this comment

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

FWIW, I agree with making it internal-only.

@encukou
Copy link
Member

Superseded by #135938

@encukouencukou closed this Jun 26, 2025
@ZeroIntensityZeroIntensity deleted the document-get-builtins branch June 26, 2025 11:30
@AA-TurnerAA-Turner removed the needs backport to 3.14 bugs and security fixes label Aug 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants

@ZeroIntensity@encukou@ericsnowcurrently@AA-Turner