Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Python 3.13 CI #587
Add Python 3.13 CI #587
Changes from 28 commits
70de9df
d2b0b27
f4f6ea2
d19acc8
aaf07af
d7d4bf9
d269cc9
d89746c
dce2f06
2555dbd
45119b1
f6abe3d
7ddadf4
2266d9d
2adb9d4
87ffaa1
f820bab
281d3c6
e94ed91
c5ff663
3577f75
5b38b52
0b598b0
3fc70f2
dfcafc4
c517439
267a4b9
7801abe
2544616
9fa3ac2
0b7bd7f
b3d571e
0d591fa
5b960e8
ef9ddd1
9d3c674
d5c0226
bfb523b
634cccf
fdf644c
80de4fc
171843e
7848649
76df344
4b68a14
af82781
9277ac2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic is copy/pasted a lot of time. How about backporting PyWeakref_GetRef to older versions
module.h:
module.c:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/python/cpython/blob/a9c2bc16349c2be3005f97249f3ae9699988f218/Objects/weakrefobject.c#L931-L947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we can backport it.
PyWeakref_GetRef
depends upon the internal function_PyWeakref_GetRef
, which is probably located at https://fossies.org/linux/misc/Python-3.13.0rc2.tar.xz/Python-3.13.0rc2/Include/internal/pycore_weakref.h, and that function also depends upon several internal functions.We can potentially add
PyWeakref_GetRef
, which callsPyWeakref_GetObject
and also increments the ref count, so that we can avoid the copy-paste.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated. I have created a new function which abstracts the differences between APIs into a single place, and we don't need to do any code duplication. I didn't define
PyWeakref_GetRef
for pre-Python 3.13 because I thought it would be confusing for future readers that we are calling the Python 3.13+ function, and having our own definition for pre-Python 3.13 which does something slightly different.