Skip to content

Commit 2d00576

Browse files
Deploy preview for PR 1133 🛫
1 parent 72d5b04 commit 2d00576

File tree

562 files changed

+1584
-1480
lines changed

Some content is hidden

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

562 files changed

+1584
-1480
lines changed

pr-preview/pr-1133/_sources/extending/extending.rst.txt

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,37 @@ the module and a copyright notice if you like).
7575
See :ref:`arg-parsing-string-and-buffers` for a description of this macro.
7676

7777
All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
78-
``PY``, except those defined in standard header files. For convenience, and
79-
since they are used extensively by the Python interpreter, ``"Python.h"``
80-
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
81-
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
82-
your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
83-
:c:func:`realloc` directly.
78+
``PY``, except those defined in standard header files.
79+
80+
.. tip::
81+
82+
For backward compatibility, :file:`Python.h` includes several standard header files.
83+
C extensions should include the standard headers that they use,
84+
and should not rely on these implicit includes.
85+
If using the limited C API version 3.13 or newer, the implicit includes are:
86+
87+
* ``<assert.h>``
88+
* ``<intrin.h>`` (on Windows)
89+
* ``<inttypes.h>``
90+
* ``<limits.h>``
91+
* ``<math.h>``
92+
* ``<stdarg.h>``
93+
* ``<wchar.h>``
94+
* ``<sys/types.h>`` (if present)
95+
96+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or older,
97+
the headers below are also included:
98+
99+
* ``<ctype.h>``
100+
* ``<unistd.h>`` (on POSIX)
101+
102+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or older,
103+
the headers below are also included:
104+
105+
* ``<errno.h>``
106+
* ``<stdio.h>``
107+
* ``<stdlib.h>``
108+
* ``<string.h>``
84109

85110
The next thing we add to our module file is the C function that will be called
86111
when the Python expression ``spam.system(string)`` is evaluated (we'll see

pr-preview/pr-1133/_sources/glossary.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ Glossary
402402
with :term:`abstract base classes <abstract base class>`.) Instead, it
403403
typically employs :func:`hasattr` tests or :term:`EAFP` programming.
404404

405+
dunder
406+
An informal short-hand for "double underscore", used when talking about a
407+
:term:`special method`. For example, ``__init__`` is often pronounced
408+
"dunder init".
409+
405410
EAFP
406411
Easier to ask for forgiveness than permission. This common Python coding
407412
style assumes the existence of valid keys or attributes and catches
@@ -1399,6 +1404,11 @@ Glossary
13991404
A computer defined entirely in software. Python's virtual machine
14001405
executes the :term:`bytecode` emitted by the bytecode compiler.
14011406

1407+
walrus operator
1408+
A light-hearted way to refer to the :ref:`assignment expression
1409+
<assignment-expressions>` operator ``:=`` because it looks a bit like a
1410+
walrus if you turn your head.
1411+
14021412
Zen of Python
14031413
Listing of Python design principles and philosophies that are helpful in
14041414
understanding and using the language. The listing can be found by typing

pr-preview/pr-1133/_sources/library/codecs.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ particular, the following variants typically exist:
12431243
+-----------------+--------------------------------+--------------------------------+
12441244
| iso8859_3 | iso-8859-3, latin3, L3 | Esperanto, Maltese |
12451245
+-----------------+--------------------------------+--------------------------------+
1246-
| iso8859_4 | iso-8859-4, latin4, L4 | Baltic languages |
1246+
| iso8859_4 | iso-8859-4, latin4, L4 | Northern Europe |
12471247
+-----------------+--------------------------------+--------------------------------+
12481248
| iso8859_5 | iso-8859-5, cyrillic | Belarusian, Bulgarian, |
12491249
| | | Macedonian, Russian, Serbian |

pr-preview/pr-1133/_sources/library/fractions.rst.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
The :mod:`fractions` module provides support for rational number arithmetic.
1515

1616

17-
A Fraction instance can be constructed from a pair of integers, from
18-
another rational number, or from a string.
17+
A Fraction instance can be constructed from a pair of rational numbers, from
18+
a single number, or from a string.
1919

2020
.. class:: Fraction(numerator=0, denominator=1)
2121
Fraction(other_fraction)
@@ -25,7 +25,7 @@ another rational number, or from a string.
2525

2626
The first version requires that *numerator* and *denominator* are instances
2727
of :class:`numbers.Rational` and returns a new :class:`Fraction` instance
28-
with value ``numerator/denominator``. If *denominator* is ``0``, it
28+
with a value equal to ``numerator/denominator``. If *denominator* is zero, it
2929
raises a :exc:`ZeroDivisionError`. The second version requires that
3030
*other_fraction* is an instance of :class:`numbers.Rational` and returns a
3131
:class:`Fraction` instance with the same value. The next two versions accept
@@ -116,7 +116,8 @@ another rational number, or from a string.
116116

117117
.. attribute:: denominator
118118

119-
Denominator of the Fraction in lowest term.
119+
Denominator of the Fraction in lowest terms.
120+
Guaranteed to be positive.
120121

121122

122123
.. method:: as_integer_ratio()

pr-preview/pr-1133/_sources/library/numbers.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ The numeric tower
6969

7070
.. attribute:: numerator
7171

72-
Abstract.
72+
Abstract. The numerator of this rational number.
7373

7474
.. attribute:: denominator
7575

76-
Abstract.
76+
Abstract. The denominator of this rational number.
7777

7878

7979
.. class:: Integral

pr-preview/pr-1133/_static/glossary.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pr-preview/pr-1133/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ <h3>瀏覽</h3>
320320
<a href="https://www.python.org/psf/donations/">Please donate.</a>
321321
<br>
322322
<br>
323-
最後更新於 8月 04, 2025 (00:24 UTC)。
323+
最後更新於 8月 06, 2025 (00:22 UTC)。
324324

325325
<a href="/bugs.html">Found a bug</a>?
326326

pr-preview/pr-1133/bugs.html

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

@@ -359,7 +359,7 @@ <h3>瀏覽</h3>
359359
<a href="https://www.python.org/psf/donations/">Please donate.</a>
360360
<br>
361361
<br>
362-
最後更新於 8月 04, 2025 (00:24 UTC)。
362+
最後更新於 8月 06, 2025 (00:22 UTC)。
363363

364364
<a href="/bugs.html">Found a bug</a>?
365365

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<a href="https://www.python.org/psf/donations/">Please donate.</a>
330330
<br>
331331
<br>
332-
最後更新於 8月 04, 2025 (00:24 UTC)。
332+
最後更新於 8月 06, 2025 (00:22 UTC)。
333333

334334
<a href="/bugs.html">Found a bug</a>?
335335

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ <h3>瀏覽</h3>
346346
<a href="https://www.python.org/psf/donations/">Please donate.</a>
347347
<br>
348348
<br>
349-
最後更新於 8月 04, 2025 (00:24 UTC)。
349+
最後更新於 8月 06, 2025 (00:22 UTC)。
350350

351351
<a href="/bugs.html">Found a bug</a>?
352352

0 commit comments

Comments
 (0)