Skip to content

Commit 507dc54

Browse files
committed
Deploy preview for PR 1160 🛫
1 parent 6a603c3 commit 507dc54

File tree

572 files changed

+731
-688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

572 files changed

+731
-688
lines changed

pr-preview/pr-1160/_sources/c-api/bytes.rst.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,38 @@ called with a non-bytes parameter.
219219
reallocation fails, the original bytes object at *\*bytes* is deallocated,
220220
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
221221
returned.
222+
223+
224+
.. c:function:: PyObject *PyBytes_Repr(PyObject *bytes, int smartquotes)
225+
226+
Get the string representation of *bytes*. This function is currently used to
227+
implement :meth:`!bytes.__repr__` in Python.
228+
229+
This function does not do type checking; it is undefined behavior to pass
230+
*bytes* as a non-bytes object or ``NULL``.
231+
232+
If *smartquotes* is true, the representation will use a double-quoted string
233+
instead of single-quoted string when single-quotes are present in *bytes*.
234+
For example, the byte string ``'Python'`` would be represented as
235+
``b"'Python'"`` when *smartquotes* is true, or ``b'\'Python\''`` when it is
236+
false.
237+
238+
On success, this function returns a :term:`strong reference` to a
239+
:class:`str` object containing the representation. On failure, this
240+
returns ``NULL`` with an exception set.
241+
242+
243+
.. c:function:: PyObject *PyBytes_DecodeEscape(const char *s, Py_ssize_t len, const char *errors, Py_ssize_t unicode, const char *recode_encoding)
244+
245+
Unescape a backslash-escaped string *s*. *s* must not be ``NULL``.
246+
*len* must be the size of *s*.
247+
248+
*errors* must be one of ``"strict"``, ``"replace"``, or ``"ignore"``. If
249+
*errors* is ``NULL``, then ``"strict"`` is used by default.
250+
251+
On success, this function returns a :term:`strong reference` to a Python
252+
:class:`bytes` object containing the unescaped string. On failure, this
253+
function returns ``NULL`` with an exception set.
254+
255+
.. versionchanged:: 3.9
256+
*unicode* and *recode_encoding* are now unused.

pr-preview/pr-1160/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ <h3>導航</h3>
314314
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
315315
<br>
316316
<br>
317-
最後更新於 11月 12, 2025 (00:21 UTC)。
317+
最後更新於 11月 12, 2025 (03:35 UTC)。
318318

319319
<a href="/bugs.html">發現 bug</a>
320320

pr-preview/pr-1160/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ <h3>導航</h3>
351351
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
352352
<br>
353353
<br>
354-
最後更新於 11月 12, 2025 (00:21 UTC)。
354+
最後更新於 11月 12, 2025 (03:35 UTC)。
355355

356356
<a href="/bugs.html">發現 bug</a>
357357

pr-preview/pr-1160/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ <h3>導航</h3>
323323
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
324324
<br>
325325
<br>
326-
最後更新於 11月 12, 2025 (00:21 UTC)。
326+
最後更新於 11月 12, 2025 (03:35 UTC)。
327327

328328
<a href="/bugs.html">發現 bug</a>
329329

pr-preview/pr-1160/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ <h3>導航</h3>
532532
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
533533
<br>
534534
<br>
535-
最後更新於 11月 12, 2025 (00:21 UTC)。
535+
最後更新於 11月 12, 2025 (03:35 UTC)。
536536

537537
<a href="/bugs.html">發現 bug</a>
538538

pr-preview/pr-1160/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ <h3>導航</h3>
471471
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
472472
<br>
473473
<br>
474-
最後更新於 11月 12, 2025 (00:21 UTC)。
474+
最後更新於 11月 12, 2025 (03:35 UTC)。
475475

476476
<a href="/bugs.html">發現 bug</a>
477477

pr-preview/pr-1160/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ <h3>導航</h3>
954954
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
955955
<br>
956956
<br>
957-
最後更新於 11月 12, 2025 (00:21 UTC)。
957+
最後更新於 11月 12, 2025 (03:35 UTC)。
958958

959959
<a href="/bugs.html">發現 bug</a>
960960

pr-preview/pr-1160/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ <h3>導航</h3>
334334
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
335335
<br>
336336
<br>
337-
最後更新於 11月 12, 2025 (00:21 UTC)。
337+
最後更新於 11月 12, 2025 (03:35 UTC)。
338338

339339
<a href="/bugs.html">發現 bug</a>
340340

pr-preview/pr-1160/c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ <h3>導航</h3>
10221022
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10231023
<br>
10241024
<br>
1025-
最後更新於 11月 12, 2025 (00:21 UTC)。
1025+
最後更新於 11月 12, 2025 (03:35 UTC)。
10261026

10271027
<a href="/bugs.html">發現 bug</a>
10281028

pr-preview/pr-1160/c-api/bytearray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ <h3>導航</h3>
397397
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
398398
<br>
399399
<br>
400-
最後更新於 11月 12, 2025 (00:21 UTC)。
400+
最後更新於 11月 12, 2025 (03:35 UTC)。
401401

402402
<a href="/bugs.html">發現 bug</a>
403403

0 commit comments

Comments
 (0)