Skip to content

Commit 52270bf

Browse files
Deploy preview for PR 1172 🛫
1 parent 49ddc76 commit 52270bf

File tree

579 files changed

+662
-616
lines changed

Some content is hidden

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

579 files changed

+662
-616
lines changed

pr-preview/pr-1172/_sources/c-api/intro.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ complete listing.
171171
Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the
172172
command line (see :c:member:`PyConfig.use_environment`).
173173

174+
.. c:macro:: Py_LOCAL(type)
175+
176+
Declare a function returning the specified *type* using a fast-calling
177+
qualifier for functions that are local to the current file.
178+
Semantically, this is equivalent to ``static type``.
179+
180+
.. c:macro:: Py_LOCAL_INLINE(type)
181+
182+
Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function
183+
be inlined.
184+
174185
.. c:macro:: Py_MAX(x, y)
175186
176187
Return the maximum value between ``x`` and ``y``.

pr-preview/pr-1172/_sources/c-api/structures.rst.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,12 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
698698
entry indicates an offset from the subclass-specific data, rather than
699699
from ``PyObject``.
700700
701-
Can only be used as part of :c:member:`Py_tp_members <PyTypeObject.tp_members>`
701+
Can only be used as part of the :c:data:`Py_tp_members`
702702
:c:type:`slot <PyType_Slot>` when creating a class using negative
703703
:c:member:`~PyType_Spec.basicsize`.
704704
It is mandatory in that case.
705-
706-
This flag is only used in :c:type:`PyType_Slot`.
707-
When setting :c:member:`~PyTypeObject.tp_members` during
708-
class creation, Python clears it and sets
705+
When setting :c:member:`~PyTypeObject.tp_members` from the slot during
706+
class creation, Python clears the flag and sets
709707
:c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct.
710708
711709
.. index::

pr-preview/pr-1172/_sources/c-api/type.rst.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ The following functions and structs are used to create
383383
384384
The *bases* argument can be used to specify base classes; it can either
385385
be only one class or a tuple of classes.
386-
If *bases* is ``NULL``, the *Py_tp_bases* slot is used instead.
387-
If that also is ``NULL``, the *Py_tp_base* slot is used instead.
386+
If *bases* is ``NULL``, the :c:data:`Py_tp_bases` slot is used instead.
387+
If that also is ``NULL``, the :c:data:`Py_tp_base` slot is used instead.
388388
If that also is ``NULL``, the new type derives from :class:`object`.
389389
390390
The *module* argument can be used to record the module in which the new
@@ -590,9 +590,9 @@ The following functions and structs are used to create
590590
:c:type:`PyAsyncMethods` with an added ``Py_`` prefix.
591591
For example, use:
592592
593-
* ``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`
594-
* ``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`
595-
* ``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`
593+
* :c:data:`Py_tp_dealloc` to set :c:member:`PyTypeObject.tp_dealloc`
594+
* :c:data:`Py_nb_add` to set :c:member:`PyNumberMethods.nb_add`
595+
* :c:data:`Py_sq_length` to set :c:member:`PySequenceMethods.sq_length`
596596
597597
An additional slot is supported that does not correspond to a
598598
:c:type:`!PyTypeObject` struct field:
@@ -611,7 +611,7 @@ The following functions and structs are used to create
611611
612612
If it is not possible to switch to a ``MANAGED`` flag (for example,
613613
for vectorcall or to support Python older than 3.12), specify the
614-
offset in :c:member:`Py_tp_members <PyTypeObject.tp_members>`.
614+
offset in :c:data:`Py_tp_members`.
615615
See :ref:`PyMemberDef documentation <pymemberdef-offsets>`
616616
for details.
617617
@@ -639,7 +639,7 @@ The following functions and structs are used to create
639639
640640
.. versionchanged:: 3.14
641641
The field :c:member:`~PyTypeObject.tp_vectorcall` can now set
642-
using ``Py_tp_vectorcall``. See the field's documentation
642+
using :c:data:`Py_tp_vectorcall`. See the field's documentation
643643
for details.
644644
645645
.. c:member:: void *pfunc
@@ -649,7 +649,7 @@ The following functions and structs are used to create
649649
650650
*pfunc* values may not be ``NULL``, except for the following slots:
651651
652-
* ``Py_tp_doc``
652+
* :c:data:`Py_tp_doc`
653653
* :c:data:`Py_tp_token` (for clarity, prefer :c:data:`Py_TP_USE_SPEC`
654654
rather than ``NULL``)
655655

pr-preview/pr-1172/_sources/c-api/typeobj.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
22582258
This field should be set to ``NULL`` and treated as read-only.
22592259
Python will fill it in when the type is :c:func:`initialized <PyType_Ready>`.
22602260

2261-
For dynamically created classes, the ``Py_tp_bases``
2261+
For dynamically created classes, the :c:data:`Py_tp_bases`
22622262
:c:type:`slot <PyType_Slot>` can be used instead of the *bases* argument
22632263
of :c:func:`PyType_FromSpecWithBases`.
22642264
The argument form is preferred.

pr-preview/pr-1172/_sources/howto/isolating-extensions.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ garbage collection protocol.
353353
That is, heap types should:
354354

355355
- Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag.
356-
- Define a traverse function using ``Py_tp_traverse``, which
356+
- Define a traverse function using :c:data:`Py_tp_traverse`, which
357357
visits the type (e.g. using ``Py_VISIT(Py_TYPE(self))``).
358358

359359
Please refer to the documentation of

pr-preview/pr-1172/_sources/library/xml.dom.pulldom.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ given point) or to make use of the :func:`DOMEventStream.expandNode` method
7474
and switch to DOM-related processing.
7575

7676

77-
.. class:: PullDom(documentFactory=None)
77+
.. class:: PullDOM(documentFactory=None)
7878

7979
Subclass of :class:`xml.sax.handler.ContentHandler`.
8080

pr-preview/pr-1172/_sources/whatsnew/2.5.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,9 +2169,9 @@ Changes to Python's build process and to the C API include:
21692169

21702170
* Two new macros can be used to indicate C functions that are local to the
21712171
current file so that a faster calling convention can be used.
2172-
``Py_LOCAL(type)`` declares the function as returning a value of the
2172+
:c:macro:`Py_LOCAL` declares the function as returning a value of the
21732173
specified *type* and uses a fast-calling qualifier.
2174-
``Py_LOCAL_INLINE(type)`` does the same thing and also requests the
2174+
:c:macro:`Py_LOCAL_INLINE` does the same thing and also requests the
21752175
function be inlined. If macro :c:macro:`!PY_LOCAL_AGGRESSIVE` is defined before
21762176
:file:`python.h` is included, a set of more aggressive optimizations are enabled
21772177
for the module; you should benchmark the results to find out if these

pr-preview/pr-1172/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月 19, 2025 (00:20 UTC)。
317+
最後更新於 11月 20, 2025 (00:20 UTC)。
318318

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

pr-preview/pr-1172/bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
229229
</section>
230230
<section id="getting-started-contributing-to-python-yourself">
231231
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
232-
<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>
232+
<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>
233233
</section>
234234
</section>
235235

@@ -351,7 +351,7 @@ <h3>導航</h3>
351351
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
352352
<br>
353353
<br>
354-
最後更新於 11月 19, 2025 (00:20 UTC)。
354+
最後更新於 11月 20, 2025 (00:20 UTC)。
355355

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

pr-preview/pr-1172/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月 19, 2025 (00:20 UTC)。
326+
最後更新於 11月 20, 2025 (00:20 UTC)。
327327

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

0 commit comments

Comments
 (0)