Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3749ca0

Browse files
Deploy preview for PR 1160 🛫
1 parent3ca9906 commit3749ca0

File tree

577 files changed

+908
-600
lines changed

Some content is hidden

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

577 files changed

+908
-600
lines changed

‎pr-preview/pr-1160/_sources/c-api/buffer.rst.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ readonly, format
261261
MUST be consistent for all consumers. For example,:c:expr:`PyBUF_SIMPLE | PyBUF_WRITABLE`
262262
can be used to request a simple writable buffer.
263263

264+
..c:macro:: PyBUF_WRITEABLE
265+
266+
This is a:term:`soft deprecated` alias to:c:macro:`PyBUF_WRITABLE`.
267+
264268
..c:macro:: PyBUF_FORMAT
265269
266270
Controls the:c:member:`~Py_buffer.format` field. If set, this field MUST

‎pr-preview/pr-1160/_sources/c-api/exceptions.rst.txt‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,23 @@ For convenience, some of these functions will always return a
331331
use.
332332
333333
334+
.. c:function:: PyObject *PyErr_ProgramTextObject(PyObject *filename, int lineno)
335+
336+
Get the source line in *filename* at line *lineno*. *filename* should be a
337+
Python:class:`str` object.
338+
339+
On success, this function returns a Python string object with the found line.
340+
On failure, this function returns ``NULL`` without an exception set.
341+
342+
343+
..c:function:: PyObject *PyErr_ProgramText(const char *filename, int lineno)
344+
345+
Similar to:c:func:`PyErr_ProgramTextObject`, but *filename* is a
346+
:c:expr:`const char *`, which is decoded with the
347+
:term:`filesystem encoding and error handler`, instead of a
348+
Python object reference.
349+
350+
334351
Issuing warnings
335352
================
336353

‎pr-preview/pr-1160/_sources/c-api/hash.rst.txt‎

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,98 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
1111

1212
..versionadded::3.2
1313

14+
1415
..c:type:: Py_uhash_t
1516
1617
Hash value type: unsigned integer.
1718

1819
..versionadded::3.2
1920

21+
22+
..c:macro:: Py_HASH_ALGORITHM
23+
24+
A numerical value indicating the algorithm for hashing of:class:`str`,
25+
:class:`bytes`, and:class:`memoryview`.
26+
27+
The algorithm name is exposed by:data:`sys.hash_info.algorithm`.
28+
29+
..versionadded::3.4
30+
31+
32+
..c:macro:: Py_HASH_FNV
33+
Py_HASH_SIPHASH24
34+
Py_HASH_SIPHASH13
35+
36+
Numerical values to compare to:c:macro:`Py_HASH_ALGORITHM` to determine
37+
which algorithm is used for hashing. The hash algorithm can be configured
38+
via the configure:option:`--with-hash-algorithm` option.
39+
40+
..versionadded::3.4
41+
Add:c:macro:`!Py_HASH_FNV` and:c:macro:`!Py_HASH_SIPHASH24`.
42+
43+
..versionadded::3.11
44+
Add:c:macro:`!Py_HASH_SIPHASH13`.
45+
46+
47+
..c:macro:: Py_HASH_CUTOFF
48+
49+
Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A
50+
instead of the algorithm described by:c:macro:`Py_HASH_ALGORITHM`.
51+
52+
- A:c:macro:`!Py_HASH_CUTOFF` of 0 disables the optimization.
53+
-:c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7.
54+
55+
32-bit platforms should use a cutoff smaller than 64-bit platforms because
56+
it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms
57+
and 5 on 32-bit platforms should provide a decent safety margin.
58+
59+
This corresponds to the:data:`sys.hash_info.cutoff` constant.
60+
61+
..versionadded::3.4
62+
63+
2064
..c:macro:: PyHASH_MODULUS
2165
22-
The `Mersenne prime<https://en.wikipedia.org/wiki/Mersenne_prime>`_ ``P = 2**n -1``, used for numeric hash scheme.
66+
The `Mersenne prime<https://en.wikipedia.org/wiki/Mersenne_prime>`_ ``P = 2**n -1``,
67+
used for numeric hash scheme.
68+
69+
This corresponds to the:data:`sys.hash_info.modulus` constant.
2370

2471
..versionadded::3.13
2572

73+
2674
..c:macro:: PyHASH_BITS
2775
2876
The exponent ``n`` of ``P`` in:c:macro:`PyHASH_MODULUS`.
2977

3078
..versionadded::3.13
3179

80+
3281
..c:macro:: PyHASH_MULTIPLIER
3382
3483
Prime multiplier used in string and various other hashes.
3584

3685
..versionadded::3.13
3786

87+
3888
..c:macro:: PyHASH_INF
3989
4090
The hash value returned for a positive infinity.
4191

92+
This corresponds to the:data:`sys.hash_info.inf` constant.
93+
4294
..versionadded::3.13
4395

96+
4497
..c:macro:: PyHASH_IMAG
4598
4699
The multiplier used for the imaginary part of a complex number.
47100

101+
This corresponds to the:data:`sys.hash_info.imag` constant.
102+
48103
..versionadded::3.13
49104

105+
50106
..c:type:: PyHash_FuncDef
51107
52108
Hash function definition used by:c:func:`PyHash_GetFuncDef`.
@@ -59,14 +115,20 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
59115
60116
Hash function name (UTF-8 encoded string).
61117

118+
This corresponds to the:data:`sys.hash_info.algorithm` constant.
119+
62120
..c:member::constint hash_bits
63121
64122
Internal size of the hash value in bits.
65123

124+
This corresponds to the:data:`sys.hash_info.hash_bits` constant.
125+
66126
..c:member::constint seed_bits
67127
68128
Size of seed input in bits.
69129

130+
This corresponds to the:data:`sys.hash_info.seed_bits` constant.
131+
70132
..versionadded::3.4
71133

72134

‎pr-preview/pr-1160/_sources/c-api/intro.rst.txt‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,32 @@ complete listing.
233233

234234
..versionadded::3.4
235235

236+
..c:macro:: Py_BUILD_ASSERT(cond)
237+
238+
Asserts a compile-time condition *cond*, as a statement.
239+
The build will fail if the condition is false or cannot be evaluated at compile time.
240+
241+
For example::
242+
243+
Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));
244+
245+
..versionadded::3.3
246+
247+
..c:macro:: Py_BUILD_ASSERT_EXPR(cond)
248+
249+
Asserts a compile-time condition *cond*, as an expression that evaluates to ``0``.
250+
The build will fail if the condition is false or cannot be evaluated at compile time.
251+
252+
For example::
253+
254+
#define foo_to_char(foo) \
255+
((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
256+
257+
..versionadded::3.3
258+
236259
..c:macro:: PyDoc_STRVAR(name, str)
237260
238-
Creates a variable with name``name`` that can be used in docstrings.
261+
Creates a variable with name*name* that can be used in docstrings.
239262
If Python is built without docstrings, the value will be empty.
240263

241264
Use:c:macro:`PyDoc_STRVAR` for docstrings to support building
@@ -267,6 +290,15 @@ complete listing.
267290
{NULL, NULL}
268291
};
269292

293+
..c:macro:: PyDoc_VAR(name)
294+
295+
Declares a static character array variable with the given name *name*.
296+
297+
For example::
298+
299+
PyDoc_VAR(python_doc) = PyDoc_STR("A genus of constricting snakes in the Pythonidae family native "
300+
"to the tropics and subtropics of the Eastern Hemisphere.");
301+
270302

271303
.. _api-objects:
272304

‎pr-preview/pr-1160/_sources/library/json.rst.txt‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ Basic Usage
183183

184184
:param bool ensure_ascii:
185185
If ``True`` (the default), the output is guaranteed to
186-
have all incoming non-ASCII characters escaped.
187-
If ``False``, these characters will be outputted as-is.
186+
have all incoming non-ASCII and non-printable characters escaped.
187+
If ``False``, all characters will be outputted as-is, except for
188+
the characters that must be escaped: quotation mark, reverse solidus,
189+
and the control characters U+0000 through U+001F.
188190

189191
:param bool check_circular:
190192
If ``False``, the circular reference check for container types is skipped
@@ -495,8 +497,10 @@ Encoders and Decoders
495497
:class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped.
496498

497499
If *ensure_ascii* is true (the default), the output is guaranteed to
498-
have all incoming non-ASCII characters escaped. If *ensure_ascii* is
499-
false, these characters will be output as-is.
500+
have all incoming non-ASCII and non-printable characters escaped.
501+
If *ensure_ascii* is false, all characters will be output as-is, except for
502+
the characters that must be escaped: quotation mark, reverse solidus,
503+
and the control characters U+0000 through U+001F.
500504

501505
If *check_circular* is true (the default), then lists, dicts, and custom
502506
encoded objects will be checked for circular references during encoding to
@@ -636,7 +640,7 @@ UTF-32, with UTF-8 being the recommended default for maximum interoperability.
636640

637641
As permitted, though not required, by the RFC, this module's serializer sets
638642
*ensure_ascii=True* by default, thus escaping the output so that the resulting
639-
strings only contain ASCII characters.
643+
strings only containprintableASCII characters.
640644

641645
Other than the *ensure_ascii* parameter, this module is defined strictly in
642646
terms of conversion between Python objects and

‎pr-preview/pr-1160/_sources/library/sys.rst.txt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,10 +1130,14 @@ always available. Unless explicitly noted otherwise, all variables are read-only
11301130

11311131
The size of the seed key of the hash algorithm
11321132

1133+
..attribute::hash_info.cutoff
1134+
1135+
Cutoff for small string DJBX33A optimization in range ``[1, cutoff)``.
1136+
11331137
..versionadded::3.2
11341138

11351139
..versionchanged::3.4
1136-
Added *algorithm*, *hash_bits*and *seed_bits*
1140+
Added *algorithm*, *hash_bits*, *seed_bits*,and *cutoff*.
11371141

11381142

11391143
..data::hexversion

‎pr-preview/pr-1160/_sources/library/time.rst.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ Functions
396396
On Windows, if *secs* is zero, the thread relinquishes the remainder of its
397397
time slice to any other thread that is ready to run. If there are no other
398398
threads ready to run, the function returns immediately, and the thread
399-
continues execution. On Windows8.1 and newer the implementation uses
399+
continues execution. On Windows10 and newer the implementation uses
400400
a `high-resolution timer
401-
<https://learn.microsoft.com/windows-hardware/drivers/kernel/high-resolution-timers>`_
401+
<https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-createwaitabletimerexw>`_
402402
which provides resolution of 100 nanoseconds. If *secs* is zero, ``Sleep(0)`` is used.
403403

404404
..rubric::Unix implementation

‎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
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
315315
<br>
316316
<br>
317-
最後更新於 11月08, 2025 (00:19 UTC)。
317+
最後更新於 11月09, 2025 (00:23 UTC)。
318318

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

‎pr-preview/pr-1160/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
<sectionid="getting-started-contributing-to-python-yourself">
231231
<spanid="contributing-to-python"></span><h2>開始讓自己貢獻 Python<aclass="headerlink"href="#getting-started-contributing-to-python-yourself"title="連結到這個標頭"></a></h2>
232-
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在<aclass="reference external"href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<aclass="reference external"href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
232+
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在<aclass="reference external"href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<aclass="reference external"href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
233233
</section>
234234
</section>
235235

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

356356
<ahref="/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
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
324324
<br>
325325
<br>
326-
最後更新於 11月08, 2025 (00:19 UTC)。
326+
最後更新於 11月09, 2025 (00:23 UTC)。
327327

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp