Uh oh!
There was an error while loading. Please reload this page.
gh-133143: Make information about the interpreter ABI more accessible - #137476
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 |
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...)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
zklaus
commented
Aug 7, 2025
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? |
encukou
commented
Aug 7, 2025
Looks good now, thanks! And, of course, it needs deciding on what should go here; but that's for the discussion thread. |
zklaus
commented
Aug 7, 2025
Agreed about the tests and further discussion. I just wanted to stabilize the implementation sufficiently to be sure to write meaningful tests. Thanks again! |
zklaus
commented
Aug 12, 2025
Tests are in place and easily extendable. Let's focus on the discussion and get this in 💪. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot
commented
Sep 5, 2025
🤖 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. |
zklaus
commented
Sep 8, 2025
encukou
commented
Sep 8, 2025
Could you add semantic Sphinx syntax for With that, I consider this good to merge :) |
sys.abi_info: Use Sphinx markup for attributes
zklaus
commented
Sep 8, 2025
Done, thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
AA-Turner
commented
Sep 8, 2025
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 |
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Sep 8, 2025
I don't think that using namespace is a big deal here. |
vstinner
commented
Sep 8, 2025
Congrats @zklaus, your PR was merged :-) |
encukou
commented
Sep 8, 2025
|
AA-Turner
commented
Sep 8, 2025
I realised that one drawback of using A |
encukou
commented
Sep 8, 2025
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 <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
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/