Conversation
|
Hm, I'm again confused about which version of the PEP we're discussing :( Why do we need the |
I prefer to have a separated parameter for that. I don't think that it would be future proof to mix formats and flags. Having a |
|
But, we might need flags for the output as well. For example, if you request a string with no lone surrogates, there should be an output flag confirming there are no lone surrogates. (Alternatively, the export function could fail on unknown flags. But then, we couldn't add a “don't add a terminating NUL” flag in a backwards-compatible way.) |
If there is an hypothetical flag to reject surrogate characters, the function must fail if the string contains a surrogate character. There is no need for output other than the error, no?
The function currently fails if flags is not equal to 0.
Let's say the the hypothetical new flag is added to Python 3.15: you should not pass the flag to Python 3.14. So you should check the Python runtime version using Py_GetVersion(). On Python 3.14, it would fail with an error. |
Now we're getting CPython-specific; that would work better as non-limited API. |
Maybe my |
|
I updated the PR to remove |
📚 Documentation preview 📚: https://pep-previews--3968.org.readthedocs.build/