Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133143: Make information about the interpreter ABI more accessible#137476

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 28 commits intopython:mainfromzklaus:add-sys.abi_info
Sep 8, 2025

Conversation

@zklaus
Copy link
Contributor

@zklauszklaus commentedAug 6, 2025
edited by encukou
Loading

This adds a newsys.abi_info object 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 thesys.thread_info andsys.int_info object as suggested inthe discussion by@encukou.

gh-133143


📚 Documentation preview 📚:https://cpython-previews--137476.org.readthedocs.build/

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

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

This is a big PR!
I'll ask you to simplify (and, alas, throw a lot of the scaffolding work away...)

@zklaus
Copy link
ContributorAuthor

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?

@zklauszklaus mentioned this pull requestAug 7, 2025
@encukou
Copy link
Member

Looks good now, thanks!
It does need a test. (Ideally comparing things tosys.maxsize andsysconfig.get_config_var, which should also serve as guide/validation for what the packaging tools will need to do for earlier Python versions.)

And, of course, it needs deciding on what should go here; but that's for the discussion thread.

zklaus reacted with thumbs up emoji

@zklaus
Copy link
ContributorAuthor

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
Copy link
ContributorAuthor

Tests are in place and easily extendable. Let's focus onthe discussion and get this in 💪.

ngoldbaum reacted with hooray emoji

@zklauszklaus marked this pull request as ready for reviewAugust 12, 2025 11:39
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

Can you also mention the new sys.abi_info in Doc/whatsnew/3.15.rst document? You should add a new "sys" section inhttps://docs.python.org/dev/whatsnew/3.15.html#improved-modules

zklaus reacted with thumbs up emoji
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@zklaus
Copy link
ContributorAuthor

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.

@encukouencukou added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelSep 5, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@encukou for commited7b6d9 🤖

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.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelSep 5, 2025
@zklaus
Copy link
ContributorAuthor

@encukou, I think the two test failures are unrelated to this PR (both from tarfile, fixed in#138626).

Is there anything left that I should do?

@encukou
Copy link
Member

Could you add semantic Sphinx syntax for.. attribute::, fromzklaus#3 ? Sorry I didn't link to it on Friday.

With that, I consider this good to merge :)

zklaus reacted with thumbs up emoji

sys.abi_info: Use Sphinx markup for attributes
@zklaus
Copy link
ContributorAuthor

Done, thanks!

AA-Turnerand others added2 commitsSeptember 8, 2025 14:29
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@encukouencukouenabled auto-merge (squash)September 8, 2025 13:50
@AA-Turner
Copy link
Member

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 forabi_info? Currently the repr showsnamespace, which could be surprising for users:

❯ .\python.bat>>>import sys>>> sys.abi_infonamespace(pointer_bits=64, free_threaded=False, debug=True, byteorder='little')

A

@encukouencukou merged commit1acb718 intopython:mainSep 8, 2025
45 checks passed
@vstinner
Copy link
Member

Separately, should we use a named type for abi_info?

I don't think that using namespace is a big deal here.

@vstinner
Copy link
Member

Congrats@zklaus, your PR was merged :-)

encukou reacted with thumbs up emojizklaus and chris-eibl reacted with rocket emoji

@encukou
Copy link
Member

should we use a named type for abi_info?

sys.implementation is a namespace too, and I haven't seen any complaints.
(float_info and such are separate types with iter & getitem for compatibility with long-gone Pythons where these weretuples. The names are nice, but not worth the complexity for new stuff.)

@AA-Turner
Copy link
Member

I realised that one drawback of usingSimpleNamespace is that the namespace is not immutable, unlike e.g.sys.version_info,sys.int_info, etc. I'm happy to continue using it given@vstinner &@encukou's comments, but perhaps we should override__setattr__? All the other_info namespaces in sys are immutable,sys.implementation seems to be the exception as far as I can tell.

A

@encukou
Copy link
Member

No need. This is Python; consenting adults; you break it you get to keep the pieces; etc.

You can already setsys.int_info = type(sys.int_info)([5, 8, 23, 864]) for example.

Comment on lines +25 to +26
The available entries are the same on all platforms;
e.g. *pointer_size* is available even on 64-bit-only architectures.
Copy link
Member

Choose a reason for hiding this comment

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

e.g. would have been better spelled out asfor example

lkollar pushed a commit to lkollar/cpython that referenced this pull requestSep 9, 2025
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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@merwokmerwokmerwok left review comments

@AA-TurnerAA-TurnerAA-Turner left review comments

@vstinnervstinnervstinner approved these changes

@encukouencukouencukou approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@zklaus@encukou@AA-Turner@bedevere-bot@vstinner@merwok

[8]ページ先頭

©2009-2025 Movatter.jp