Skip to content
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

[PEP 741] gh-107954: Add PyConfig_Get() function #112609

Closed
wants to merge 4 commits into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 1, 2023

Add PyConfig_Get() and PyConfig_GetInt() functions to get the current Python configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.

Discussion: https://discuss.python.org/t/fr-allow-private-runtime-config-to-enable-extending-without-breaking-the-pyconfig-abi/18004


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

Add PyConfig_Get() and PyConfig_GetInt() functions to get the current
Python configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.
@vstinner
Copy link
Member Author

vstinner commented Dec 1, 2023

This change doesn't add the new functions to the limited C API yet. They can be added in a follow-up PR.

@vstinner vstinner requested a review from a team as a code owner December 1, 2023 21:06
Doc/c-api/init_config.rst Outdated Show resolved Hide resolved
Doc/c-api/init_config.rst Outdated Show resolved Hide resolved
Copy link
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner
Copy link
Member Author

vstinner commented Dec 7, 2023

I created an issue for the C API Working Group to add this C API: capi-workgroup/decisions#3

@vstinner
Copy link
Member Author

I expected such API (two functions) to be simple to agree on, but apparently, it's more completed than expected. @encukou now suggests writing a PEP for adding these two functions. I'm already struggling to get a consensus on my PEP 737 – Unify type name formatting. I don't have the bandwidth to fight for too many APIs in parallel. I prefer to close the PR for now. I may reopen it when I will have more bandwidth to look into this topic again.

@vstinner vstinner closed this Dec 20, 2023
@vstinner vstinner deleted the config_get branch December 20, 2023 11:09
@vstinner vstinner restored the config_get branch February 8, 2024 16:05
@vstinner vstinner changed the title gh-107954: Add PyConfig_Get() function [PEP 741] gh-107954: Add PyConfig_Get() function May 3, 2024
@vstinner
Copy link
Member Author

Since this PR is closed, I created a new PR to implement PEP 741: #123472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants