gh-133143: Make information about the interpreter ABI more accessible#137476
gh-133143: Make information about the interpreter ABI more accessible#137476encukou merged 28 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
d572a62 to
8890dc5
Compare
encukou
left a comment
There was a problem hiding this comment.
This is a big PR!
I'll ask you to simplify (and, alas, throw a lot of the scaffolding work away...)
ab093fc to
defb2b2
Compare
|
Thanks for your review, @encukou! I think I have addressed all of your comments and, as you anticipated, it simplifies things a great deal. Would you mind taking another look? |
|
Looks good now, thanks! And, of course, it needs deciding on what should go here; but that's for the discussion thread. |
|
Agreed about the tests and further discussion. I just wanted to stabilize the implementation sufficiently to be sure to write meaningful tests. Thanks again! |
|
Tests are in place and easily extendable. Let's focus on the discussion and get this in 💪. |
vstinner
left a comment
There was a problem hiding this comment.
Can you also mention the new sys.abi_info in Doc/whatsnew/3.15.rst document? You should add a new "sys" section in https://docs.python.org/dev/whatsnew/3.15.html#improved-modules
|
With the latest addition of comments on the Windows side of things, I think I addressed all comments. @AA-Turner apologies again for the rebase snafu. I hope a review is still doable. |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit ed7b6d9 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F137476%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Could you add semantic Sphinx syntax for With that, I consider this good to merge :) |
sys.abi_info: Use Sphinx markup for attributes
|
Done, thanks! |
Co-authored-by: Adam Turner <[email protected]>
|
oops, I meant to push to my own branch to propose a PR to @zklaus's repo, sorry. Given Petr has enabled auto-merge already I'll propose my changes in a follow-up. Separately, should we use a named type for ❯ .\python.bat
>>> import sys
>>> sys.abi_info
namespace(pointer_bits=64, free_threaded=False, debug=True, byteorder='little')A |
I don't think that using namespace is a big deal here. |
|
Congrats @zklaus, your PR was merged :-) |
|
|
I realised that one drawback of using A |
|
No need. This is Python; consenting adults; you break it you get to keep the pieces; etc. You can already set |
| The available entries are the same on all platforms; | ||
| e.g. *pointer_size* is available even on 64-bit-only architectures. |
There was a problem hiding this comment.
e.g. would have been better spelled out as for example
This makes information about the interpreter ABI more accessible. Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Adam Turner <[email protected]>
This adds a new
sys.abi_infoobject to make basic abi information more readily accessible.The basic idea is to have not just flags as originally envisioned in #133143, but rather a more pythonic object with the required information, following the model of the
sys.thread_infoandsys.int_infoobject as suggested in the discussion by @encukou.gh-133143
📚 Documentation preview 📚: https://cpython-previews--137476.org.readthedocs.build/