Skip to content

Commit 3021fc3

Browse files
Deploy preview for PR 1214 🛫
1 parent 3e0f278 commit 3021fc3

File tree

584 files changed

+695
-611
lines changed

Some content is hidden

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

584 files changed

+695
-611
lines changed

pr-preview/pr-1214/_sources/c-api/bytearray.rst.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Direct API functions
4444
4545
On failure, return ``NULL`` with an exception set.
4646
47+
.. note::
48+
If the object implements the buffer protocol, then the buffer
49+
must not be mutated while the bytearray object is being created.
50+
4751
4852
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4953
@@ -58,6 +62,10 @@ Direct API functions
5862
5963
On failure, return ``NULL`` with an exception set.
6064
65+
.. note::
66+
If the object implements the buffer protocol, then the buffer
67+
must not be mutated while the bytearray object is being created.
68+
6169
6270
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
6371
@@ -70,6 +78,9 @@ Direct API functions
7078
``NULL`` pointer. The returned array always has an extra
7179
null byte appended.
7280
81+
.. note::
82+
It is not thread-safe to mutate the bytearray object while using the returned char array.
83+
7384
7485
.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
7586
@@ -89,6 +100,9 @@ These macros trade safety for speed and they don't check pointers.
89100
90101
Similar to :c:func:`PyByteArray_AsString`, but without error checking.
91102
103+
.. note::
104+
It is not thread-safe to mutate the bytearray object while using the returned char array.
105+
92106
93107
.. c:function:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray)
94108

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ called with a non-bytes parameter.
123123
Return the bytes representation of object *o* that implements the buffer
124124
protocol.
125125
126+
.. note::
127+
If the object implements the buffer protocol, then the buffer
128+
must not be mutated while the bytes object is being created.
129+
126130
127131
.. c:function:: Py_ssize_t PyBytes_Size(PyObject *o)
128132
@@ -181,13 +185,20 @@ called with a non-bytes parameter.
181185
created, the old reference to *bytes* will still be discarded and the value
182186
of *\*bytes* will be set to ``NULL``; the appropriate exception will be set.
183187
188+
.. note::
189+
If *newpart* implements the buffer protocol, then the buffer
190+
must not be mutated while the new bytes object is being created.
184191
185192
.. c:function:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)
186193
187194
Create a new bytes object in *\*bytes* containing the contents of *newpart*
188195
appended to *bytes*. This version releases the :term:`strong reference`
189196
to *newpart* (i.e. decrements its reference count).
190197
198+
.. note::
199+
If *newpart* implements the buffer protocol, then the buffer
200+
must not be mutated while the new bytes object is being created.
201+
191202
192203
.. c:function:: PyObject* PyBytes_Join(PyObject *sep, PyObject *iterable)
193204
@@ -206,6 +217,9 @@ called with a non-bytes parameter.
206217
207218
.. versionadded:: 3.14
208219
220+
.. note::
221+
If *iterable* objects implement the buffer protocol, then the buffers
222+
must not be mutated while the new bytes object is being created.
209223
210224
.. c:function:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)
211225

pr-preview/pr-1214/_sources/library/struct.rst.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ platform-dependent.
254254
+--------+--------------------------+--------------------+----------------+------------+
255255
| ``N`` | :c:type:`size_t` | integer | | \(3) |
256256
+--------+--------------------------+--------------------+----------------+------------+
257-
| ``e`` | \(6) | float | 2 | \(4) |
257+
| ``e`` | :c:expr:`_Float16` | float | 2 | \(4), \(6) |
258258
+--------+--------------------------+--------------------+----------------+------------+
259259
| ``f`` | :c:expr:`float` | float | 4 | \(4) |
260260
+--------+--------------------------+--------------------+----------------+------------+
@@ -328,7 +328,9 @@ Notes:
328328
revision of the `IEEE 754 standard <ieee 754 standard_>`_. It has a sign
329329
bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored),
330330
and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04``
331-
at full precision. This type is not widely supported by C compilers: on a
331+
at full precision. This type is not widely supported by C compilers:
332+
it's available as :c:expr:`_Float16` type, if the compiler supports the Annex H
333+
of the C23 standard. On a
332334
typical machine, an unsigned short can be used for storage, but not for math
333335
operations. See the Wikipedia page on the `half-precision floating-point
334336
format <half precision format_>`_ for more information.

pr-preview/pr-1214/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 3月 27, 2026 (00:28 UTC)。
359+
最後更新於 3月 28, 2026 (00:27 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1214/bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
250250
</section>
251251
<section id="getting-started-contributing-to-python-yourself">
252252
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
253-
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
253+
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
254254
</section>
255255
</section>
256256

@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 3月 27, 2026 (00:28 UTC)。
396+
最後更新於 3月 28, 2026 (00:27 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 3月 27, 2026 (00:28 UTC)。
368+
最後更新於 3月 28, 2026 (00:27 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ <h3>導航</h3>
574574
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
575575
<br>
576576
<br>
577-
最後更新於 3月 27, 2026 (00:28 UTC)。
577+
最後更新於 3月 28, 2026 (00:27 UTC)。
578578

579579
<a href="/bugs.html">發現 bug</a>
580580

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 3月 27, 2026 (00:28 UTC)。
517+
最後更新於 3月 28, 2026 (00:27 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 3月 27, 2026 (00:28 UTC)。
999+
最後更新於 3月 28, 2026 (00:27 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 3月 27, 2026 (00:28 UTC)。
379+
最後更新於 3月 28, 2026 (00:27 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

0 commit comments

Comments
 (0)