Skip to content

Commit 1f316ea

Browse files
authored
bpo-41123: Remove Py_UNICODE_COPY() and Py_UNICODE_FILL() (pythonGH-28887)
1 parent 03ea862 commit 1f316ea

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,3 +591,8 @@ Removed
591591
* ``Py_SET_ERRNO_ON_MATH_ERROR()``
592592

593593
(Contributed by Victor Stinner in :issue:`45412`.)
594+
595+
* Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated
596+
since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()``
597+
(``wchar_t*`` string), and ``PyUnicode_Fill()`` functions instead.
598+
(Contributed by Victor Stinner in :issue:`41123`.)

Include/cpython/unicodeobject.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@
5050
Py_UNICODE_ISDIGIT(ch) || \
5151
Py_UNICODE_ISNUMERIC(ch))
5252

53-
Py_DEPRECATED(3.3) static inline void
54-
Py_UNICODE_COPY(Py_UNICODE *target, const Py_UNICODE *source, Py_ssize_t length) {
55-
memcpy(target, source, (size_t)(length) * sizeof(Py_UNICODE));
56-
}
57-
58-
Py_DEPRECATED(3.3) static inline void
59-
Py_UNICODE_FILL(Py_UNICODE *target, Py_UNICODE value, Py_ssize_t length) {
60-
Py_ssize_t i;
61-
for (i = 0; i < length; i++) {
62-
target[i] = value;
63-
}
64-
}
65-
6653
/* macros to work with surrogates */
6754
#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF)
6855
#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated
2+
since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()``
3+
(``wchar_t*`` string), and ``PyUnicode_Fill()`` functions instead. Patch by
4+
Victor Stinner.

0 commit comments

Comments
 (0)