-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-36763: Add PyConfig_SetWideStringList() #14444
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
Conversation
|
@zooba, @methane, @Yhg1s: What do you think of adding PyConfig_SetWideStringList to https://www.python.org/dev/peps/pep-0587/ ? IMHO this function is missing to make the API "complete". Even if technically, PyWideStringList_Append() should be enough for most usage :-) While I wrote PR #14445 to cleanup old code of the implementation of the PEP 587, I failed to convert test_init_from_config() in Programs/_testembed.c to dynamically allocated memory. PyConfig API doesn't provide any function to set a wide string list, whereas the test sets warnoptions and xoptions. While PyWideStringList_Append() could be used, I prefer to be able to provide a list created in pure C without PyConfig API "at once". First, I wrote: But there is no way to build a wide string list: I didn't add any API for that on purpose, to minimize the size of the API. There is no function to create an empty PyWideStringList, no function to clear a list, no function to copy a list, etc. Maybe tomorrow we may want to add such functions, but it can be done later. I prefer to start with a smaller API. |
PyConfig_SetWideStringList() is different because first it clears the list, so options set previously are ignored. And I would like this behavior: replace existing list with my own list :-) |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
GH-14523 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit 36242fd) Co-authored-by: Victor Stinner <[email protected]>
|
Hum, I decided to merge this PR soon to try to get PR #14445 fix into Python 3.8 beta2, to have more time to test it before 3.8.0 final. We still have time to revisit the PyConfig_SetWideStringList API before 3.8.0 final if sometimes dislikes it :-) |
(cherry picked from commit 36242fd) Co-authored-by: Victor Stinner <[email protected]>
https://bugs.python.org/issue36763