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

bpo-36203: Check callback is callable in PyWeakref_NewRef #26273

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tekknolagi
Copy link
Contributor

@tekknolagi tekknolagi commented May 20, 2021

The documentation says that PyWeakref_NewRef should raise a
TypeError if the callback is not callable, None, or NULL, but the code
does not reflect the documentation. This PR fixes that.

This should probably be backported to whatever version of Python
changed that documentation.

https://bugs.python.org/issue36203

The documentation says that `PyWeakref_NewRef` should raise a
`TypeError` if the callback is not callable, None, or NULL, but the code
does not reflect the documentation. This PR fixes that.
@tekknolagi tekknolagi changed the title Check callback is callable in PyWeakref_NewRef bpo-36203: Check callback is callable in PyWeakref_NewRef May 20, 2021
@tekknolagi
Copy link
Contributor Author

Tests failing seem entirely unrelated

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 21, 2021
@tekknolagi
Copy link
Contributor Author

bump? :)

Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

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

Runs ok on my Ubuntu.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 8, 2022
Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

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

This has merge conflicts now.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@cpython-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@@ -0,0 +1 @@
Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred.
Amend :c:func:`PyWeakref_New` to raise :exc:`TypeError` if the *callback* given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants