-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-128863: Deprecate the private _PyUnicodeWriter API #129245
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e1fd675
gh-128863: Deprecate the private _PyUnicodeWriter API
vstinner 2ec2b46
Replace Init with PyUnicodeWriter_Create(0)
vstinner c8e6c22
Elaborate how to update code
vstinner fd90cab
Merge branch 'main' into deprecate_writer
vstinner 959a603
Rename the macro to _Py_DEPRECATED_EXTERNALLY
vstinner a2df55c
Update NEWS entry
vstinner a423553
Don't redefine _Py_DEPRECATED_EXTERNALLY()
vstinner 2a01b13
Document _PyUnicodeWriter_Prepare() deprecation
vstinner 04223cb
Merge branch 'main' into deprecate_writer
vstinner d650aae
Fix doc
vstinner a73e7fc
Merge branch 'main' into deprecate_writer
vstinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Misc/NEWS.d/next/C_API/2025-02-19-14-41-26.gh-issue-128863.TELwyV.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
The following private functions are deprecated and planned for removal in | ||
Python 3.18: | ||
|
||
* :c:func:`!_PyUnicodeWriter_Init`: | ||
replace ``_PyUnicodeWriter_Init(&writer)`` with | ||
:c:func:`writer = PyUnicodeWriter_Create(0) <PyUnicodeWriter_Create>`. | ||
* :c:func:`!_PyUnicodeWriter_Finish`: | ||
replace ``_PyUnicodeWriter_Finish(&writer)`` with | ||
:c:func:`PyUnicodeWriter_Finish(writer) <PyUnicodeWriter_Finish>`. | ||
* :c:func:`!_PyUnicodeWriter_Dealloc`: | ||
replace ``_PyUnicodeWriter_Dealloc(&writer)`` with | ||
:c:func:`PyUnicodeWriter_Discard(writer) <PyUnicodeWriter_Discard>`. | ||
* :c:func:`!_PyUnicodeWriter_WriteChar`: | ||
replace ``_PyUnicodeWriter_WriteChar(&writer, ch)`` with | ||
:c:func:`PyUnicodeWriter_WriteChar(writer, ch) <PyUnicodeWriter_WriteChar>`. | ||
* :c:func:`!_PyUnicodeWriter_WriteStr`: | ||
replace ``_PyUnicodeWriter_WriteStr(&writer, str)`` with | ||
:c:func:`PyUnicodeWriter_WriteStr(writer, str) <PyUnicodeWriter_WriteStr>`. | ||
* :c:func:`!_PyUnicodeWriter_WriteSubstring`: | ||
replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with | ||
:c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) <PyUnicodeWriter_WriteSubstring>`. | ||
* :c:func:`!_PyUnicodeWriter_WriteASCIIString`: | ||
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with | ||
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`. | ||
* :c:func:`!_PyUnicodeWriter_WriteLatin1String`: | ||
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with | ||
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`. | ||
* :c:func:`!_PyUnicodeWriter_Prepare`: (no replacement). | ||
* :c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement). | ||
|
||
The `pythoncapi-compat project | ||
<https://github.com/python/pythoncapi-compat/>`__ can be used to get these | ||
new public functions on Python 3.13 and older. | ||
|
||
Patch by Victor Stinner. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.