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
feat: free-threaded Python (3.13.0+) support #165
feat: free-threaded Python (3.13.0+) support #165
Changes from 2 commits
f335468
a1fb456
e93774a
e65f8ff
6a0f8fe
2cb3314
fe97888
ab38dcb
16ba89a
40ef816
a5718c1
9aa8250
752a0a7
e1f841b
0165921
31b9010
ccc3253
d972d96
4058638
173592d
eea87e7
c9d7bfa
1c51917
99f130a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is not correct in the context of how you are using it. It needs to be checked if it's set to "1"; at least in my builds, it's explicitly set to "0":
After some more reading, I actually think that
sys.abiflags
is the more appropriate place to check, since it's specifically mentioned as being set for debug builds, https://docs.python.org/3.10/using/configure.html#python-debug-build: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.
Sorry for my flip-flopping; it actually looks like
.get_config_var
is correct, since it seems to return an int when used like this. That said, maybe we should still prefersys.abiflags
since it's more explicitly documented?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.
Py_DEBUG
is also explicitly mentioned there. Also a quick ChatGPT inquiry yields this;I think we should be comfortable with using the value of
Py_DEBUG
insysconfig
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.
I'm not confident that
Py_DEBUG and Py_REF_DEBUG macros
are guaranteed to be equivalent to "config vars"; that said, it looks likesys.abiflags
doesn't work on Windows, so I guess get_config_var is the best way for now.It looks like there was a patch many years ago to add an official way to look up if it was built with debug, but it was not merged. python/cpython#69443
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.
Although originally unintentional (I think), this is a change in behavior vs the current release. I might suggest Colin or I follow up with a PR, unless this is newly tested in this PR?
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.
It isn't explicitly tested. But the code path does get executed implicitly in
jpy_typeconv_test_pyobj.py
.