@@ -136,48 +136,6 @@ which disallows mutable objects such as :class:`bytearray`.
136
136
attempting any conversion. Raises :exc: `TypeError ` if the object is not
137
137
a :class: `bytearray ` object. The C variable may also be declared as :c:expr: `PyObject* `.
138
138
139
- ``u `` (:class: `str `) [const Py_UNICODE \* ]
140
- Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of
141
- Unicode characters. You must pass the address of a :c:type: `Py_UNICODE `
142
- pointer variable, which will be filled with the pointer to an existing
143
- Unicode buffer. Please note that the width of a :c:type: `Py_UNICODE `
144
- character depends on compilation options (it is either 16 or 32 bits).
145
- The Python string must not contain embedded null code points; if it does,
146
- a :exc: `ValueError ` exception is raised.
147
-
148
- .. versionchanged :: 3.5
149
- Previously, :exc: `TypeError ` was raised when embedded null code points
150
- were encountered in the Python string.
151
-
152
- .. deprecated-removed :: 3.3 3.12
153
- Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
154
- :c:func: `PyUnicode_AsWideCharString `.
155
-
156
- ``u# `` (:class: `str `) [const Py_UNICODE \* , :c:type: `Py_ssize_t `]
157
- This variant on ``u `` stores into two C variables, the first one a pointer to a
158
- Unicode data buffer, the second one its length. This variant allows
159
- null code points.
160
-
161
- .. deprecated-removed :: 3.3 3.12
162
- Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
163
- :c:func: `PyUnicode_AsWideCharString `.
164
-
165
- ``Z `` (:class: `str ` or ``None ``) [const Py_UNICODE \* ]
166
- Like ``u ``, but the Python object may also be ``None ``, in which case the
167
- :c:type: `Py_UNICODE ` pointer is set to ``NULL ``.
168
-
169
- .. deprecated-removed :: 3.3 3.12
170
- Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
171
- :c:func: `PyUnicode_AsWideCharString `.
172
-
173
- ``Z# `` (:class: `str ` or ``None ``) [const Py_UNICODE \* , :c:type: `Py_ssize_t `]
174
- Like ``u# ``, but the Python object may also be ``None ``, in which case the
175
- :c:type: `Py_UNICODE ` pointer is set to ``NULL ``.
176
-
177
- .. deprecated-removed :: 3.3 3.12
178
- Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
179
- :c:func: `PyUnicode_AsWideCharString `.
180
-
181
139
``U `` (:class: `str `) [PyObject \* ]
182
140
Requires that the Python object is a Unicode object, without attempting
183
141
any conversion. Raises :exc: `TypeError ` if the object is not a Unicode
@@ -247,6 +205,11 @@ which disallows mutable objects such as :class:`bytearray`.
247
205
them. Instead, the implementation assumes that the byte string object uses the
248
206
encoding passed in as parameter.
249
207
208
+ .. versionchanged :: 3.12
209
+ ``u ``, ``u# ``, ``Z ``, and ``Z# `` are removed because they used a legacy
210
+ ``Py_UNICODE* `` representation.
211
+
212
+
250
213
Numbers
251
214
-------
252
215
0 commit comments