Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PyObject_CallNoArgs where applicable #3020

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

Starbuck5
Copy link
Member

  • PyObject_CallNoArgs was added in 3.9, pythoncapi_compat.h enables support for 3.8.
  • Docs say it's the "most efficient way to call a callable Python object without any argument"

This is not a performance PR, but a "use the modern thing" PR. The Python API now has this function we can use, lets use it. It's in the stable ABI, and it's a bit more explicit than the previous uses.

* PyObject_CallNoArgs was added in 3.9, pythoncapi_compat.h enables support for 3.8.
* Docs say it's the "most efficient way to call a callable Python object without any argument"
@Starbuck5 Starbuck5 requested a review from a team as a code owner July 26, 2024 04:59
@Starbuck5 Starbuck5 added the Code quality/robustness Code quality and resilience to changes label Jul 26, 2024
Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

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

Makes sense, LGTM :)

Copy link
Contributor

@gresm gresm left a comment

Choose a reason for hiding this comment

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

LGTM 👍.

@ankith26 ankith26 added this to the 2.5.1 milestone Jul 28, 2024
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR! 🎉

@ankith26 ankith26 merged commit ef3ef20 into pygame-community:main Jul 28, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants