Skip to content

[WIP] gh-107954: Add _PyConfig_Parse() #110145

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

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 30, 2023

@vstinner
Copy link
Member Author

It may be interesting to store unknown variables in a dictionary and expose it somewhere, similar to sys._xoptions. It would allow implement https://discuss.python.org/t/fr-allow-private-runtime-config-to-enable-extending-without-breaking-the-pyconfig-abi/18004 use case: private vendor-specific variables.

For that, the configuration format should have a deterministic way to get the type of unknown variable. In sys._xoptions, the key is a string and the value is a string or True if there is no value.

Looking at TOML specification, I see the following types would be interesting to support:

  • boolean
  • integer
  • string
  • array of string

@vstinner
Copy link
Member Author

vstinner commented Oct 2, 2023

I abandon this approach based on text configuration: see https://discuss.python.org/t/fr-allow-private-runtime-config-to-enable-extending-without-breaking-the-pyconfig-abi/18004/24 for the rationale.

Let's focus on PR #110176 PyInitConfig API instead which seem to be please more people.

@vstinner vstinner closed this Oct 2, 2023
@vstinner vstinner deleted the config_parse branch October 2, 2023 16:09
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.

1 participant