Skip to content

Commit a309ca8

Browse files
Deploy preview for PR 1231 🛫
1 parent ce88d82 commit a309ca8

588 files changed

Lines changed: 748 additions & 660 deletions

File tree

Some content is hidden

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

pr-preview/pr-1231/_sources/library/asyncio-stream.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ and work with streams:
4949

5050

5151
.. function:: open_connection(host=None, port=None, *, \
52-
limit=None, ssl=None, family=0, proto=0, \
52+
limit=65536, ssl=None, family=0, proto=0, \
5353
flags=0, sock=None, local_addr=None, \
5454
server_hostname=None, ssl_handshake_timeout=None, \
5555
ssl_shutdown_timeout=None, \
@@ -89,7 +89,7 @@ and work with streams:
8989

9090

9191
.. function:: start_server(client_connected_cb, host=None, \
92-
port=None, *, limit=None, \
92+
port=None, *, limit=65536, \
9393
family=socket.AF_UNSPEC, \
9494
flags=socket.AI_PASSIVE, sock=None, \
9595
backlog=100, ssl=None, reuse_address=None, \
@@ -137,7 +137,7 @@ and work with streams:
137137

138138
.. rubric:: Unix Sockets
139139

140-
.. function:: open_unix_connection(path=None, *, limit=None, \
140+
.. function:: open_unix_connection(path=None, *, limit=65536, \
141141
ssl=None, sock=None, server_hostname=None, \
142142
ssl_handshake_timeout=None, ssl_shutdown_timeout=None)
143143
:async:
@@ -169,7 +169,7 @@ and work with streams:
169169

170170

171171
.. function:: start_unix_server(client_connected_cb, path=None, \
172-
*, limit=None, sock=None, backlog=100, ssl=None, \
172+
*, limit=65536, sock=None, backlog=100, ssl=None, \
173173
ssl_handshake_timeout=None, \
174174
ssl_shutdown_timeout=None, start_serving=True, cleanup_socket=True)
175175
:async:

pr-preview/pr-1231/_sources/library/asyncio-subprocess.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Creating Subprocesses
6262
=====================
6363

6464
.. function:: create_subprocess_exec(program, *args, stdin=None, \
65-
stdout=None, stderr=None, limit=None, **kwds)
65+
stdout=None, stderr=None, limit=65536, **kwds)
6666
:async:
6767
6868
Create a subprocess.
@@ -84,7 +84,7 @@ Creating Subprocesses
8484

8585

8686
.. function:: create_subprocess_shell(cmd, stdin=None, \
87-
stdout=None, stderr=None, limit=None, **kwds)
87+
stdout=None, stderr=None, limit=65536, **kwds)
8888
:async:
8989
9090
Run the *cmd* shell command.

pr-preview/pr-1231/_sources/library/curses.rst.txt

Lines changed: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Linux and the BSD variants of Unix.
3030

3131
Whenever the documentation mentions a *character* it can be specified
3232
as an integer, a one-character Unicode string or a one-byte byte string.
33+
An integer is the code of a single encoded byte, optionally combined with
34+
attributes and a color pair, as returned by :meth:`window.inch`.
3335

3436
Whenever the documentation mentions a *character string* it can be specified
3537
as a Unicode string or a byte string.
@@ -505,8 +507,8 @@ The module :mod:`!curses` defines the following functions:
505507
.. function:: putp(str)
506508

507509
Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified
508-
terminfo capability for the current terminal. Note that the output of :func:`putp`
509-
always goes to standard output.
510+
terminfo capability, a bytes object, for the current terminal.
511+
Note that the output of :func:`putp` always goes to standard output.
510512

511513
:func:`setupterm` (or :func:`initscr`) must be called first.
512514

@@ -677,7 +679,7 @@ The module :mod:`!curses` defines the following functions:
677679
.. function:: tparm(str[, ...])
678680

679681
Instantiate the bytes object *str* with the supplied parameters, where *str* should
680-
be a parameterized string obtained from the terminfo database. For example,
682+
be a parameterized byte string obtained from the terminfo database. For example,
681683
``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
682684
result depending on terminal type. Up to nine integer parameters may be supplied.
683685

@@ -698,7 +700,8 @@ The module :mod:`!curses` defines the following functions:
698700

699701
.. function:: unctrl(ch)
700702

701-
Return a bytes object which is a printable representation of the character *ch*.
703+
Return a bytes object which is a printable representation of the character *ch*;
704+
any attributes and color pair are ignored.
702705
Control characters are represented as a caret followed by the character, for
703706
example as ``b'^C'``. Printing characters are left as they are.
704707

@@ -707,6 +710,9 @@ The module :mod:`!curses` defines the following functions:
707710

708711
Push *ch* so the next :meth:`~window.getch` will return it.
709712

713+
*ch* may be an integer (a key code or the code of an encoded byte), a byte,
714+
or a string of length 1 which encodes to a single byte.
715+
710716
.. note::
711717

712718
Only one *ch* can be pushed before :meth:`!getch` is called.
@@ -724,6 +730,9 @@ The module :mod:`!curses` defines the following functions:
724730

725731
Push *ch* so the next :meth:`~window.get_wch` will return it.
726732

733+
*ch* may be an integer (a character code, not a key code) or a string of
734+
length 1.
735+
727736
.. note::
728737

729738
Only one *ch* can be pushed before :meth:`!get_wch` is called.
@@ -1004,27 +1013,58 @@ Window objects
10041013

10051014
.. method:: window.getch([y, x])
10061015

1007-
Get a character. Note that the integer returned does *not* have to be in ASCII
1008-
range: function keys, keypad keys and so on are represented by numbers higher
1009-
than 255. In no-delay mode, return ``-1`` if there is no input, otherwise
1010-
wait until a key is pressed.
1016+
Read a key press, after moving the cursor to *y*, *x* if specified,
1017+
and return it as an integer.
1018+
The window is refreshed first if it is not a pad and was modified since
1019+
the last refresh.
1020+
Wait until a key is pressed, or return ``-1`` if the read is non-blocking
1021+
or times out (see :meth:`nodelay` and :meth:`timeout`).
1022+
1023+
An ordinary key is returned as the code of a single byte of its encoding
1024+
in the current locale,
1025+
so a character encoded with several bytes takes several calls.
1026+
For example, in a UTF-8 locale ``'é'`` is read as ``195``, then ``169``.
1027+
Use :meth:`get_wch` to read it as a single character.
1028+
1029+
In keypad mode (see :meth:`keypad`) function keys and other special keys
1030+
are returned as one of the :ref:`KEY_* constants <curses-key-constants>`,
1031+
which cannot be mistaken for an ordinary key.
1032+
Otherwise, or if their escape sequence does not arrive in time
1033+
(see :meth:`notimeout` and :func:`set_escdelay`),
1034+
their bytes are returned one at a time.
1035+
1036+
In echo mode (see :func:`echo`) the key is added to the window as by
1037+
:meth:`addch`; special keys are not echoed.
10111038

10121039

10131040
.. method:: window.get_wch([y, x])
10141041

1015-
Get a wide character. Return a character for most keys, or an integer for
1016-
function keys, keypad keys, and other special keys.
1017-
In no-delay mode, raise an exception if there is no input.
1042+
Read a key press, after moving the cursor to *y*, *x* if specified,
1043+
and return it as a one-character :class:`str`.
1044+
The window is refreshed first if it is not a pad and was modified since
1045+
the last refresh.
1046+
Wait until a key is pressed, or raise :exc:`error` if the read is
1047+
non-blocking or times out (see :meth:`nodelay` and :meth:`timeout`).
1048+
1049+
In keypad mode (see :meth:`keypad`) function keys and other special keys
1050+
are returned as one of the :ref:`KEY_* constants <curses-key-constants>`,
1051+
an integer.
1052+
Otherwise, or if their escape sequence does not arrive in time
1053+
(see :meth:`notimeout` and :func:`set_escdelay`),
1054+
their characters are returned one at a time.
1055+
1056+
In echo mode (see :func:`echo`) the key is added to the window as by
1057+
:meth:`addch`; special keys are not echoed.
10181058

10191059
.. versionadded:: 3.3
10201060

10211061

10221062
.. method:: window.getkey([y, x])
10231063

1024-
Get a character, returning a string instead of an integer, as :meth:`getch`
1025-
does. Function keys, keypad keys and other special keys return a multibyte
1026-
string containing the key name. In no-delay mode, raise an exception if
1027-
there is no input.
1064+
Read a key press as :meth:`getch` does, but return it as a :class:`str`:
1065+
an ordinary key as a one-character string, the byte decoded as Latin-1,
1066+
and a special key as its name, such as ``'KEY_UP'`` (see :func:`keyname`).
1067+
Raise :exc:`error` instead of returning ``-1`` if there is no input.
10281068

10291069

10301070
.. method:: window.getmaxyx()
@@ -1044,8 +1084,11 @@ Window objects
10441084
window.getstr(y, x)
10451085
window.getstr(y, x, n)
10461086

1047-
Read a bytes object from the user, with primitive line editing capacity.
1048-
At most *n* characters are read;
1087+
Read a line of input from the user, with primitive line editing capacity,
1088+
after moving the cursor to *y*, *x* if specified.
1089+
Return it as a bytes object, in the encoding of the current locale
1090+
and without the terminating newline.
1091+
At most *n* bytes are read;
10491092
*n* defaults to and cannot exceed 2047.
10501093

10511094
.. versionchanged:: 3.14
@@ -1147,12 +1190,11 @@ Window objects
11471190
.. method:: window.instr([n])
11481191
window.instr(y, x[, n])
11491192

1150-
Return a bytes object of characters, extracted from the window starting at the
1151-
current cursor position, or at *y*, *x* if specified, and stopping at the end
1152-
of the line. Attributes and color information are stripped
1153-
from the characters. If *n* is specified, :meth:`instr` returns a string
1154-
at most *n* characters long (exclusive of the trailing NUL).
1155-
The maximum value for *n* is 2047.
1193+
Read the text of the window from the current cursor position,
1194+
or from *y*, *x* if specified, to the end of the line,
1195+
and return it as a bytes object, in the encoding of the current locale.
1196+
Attributes and color pairs are stripped.
1197+
At most *n* bytes are read; *n* defaults to and cannot exceed 2047.
11561198

11571199
.. versionchanged:: 3.14
11581200
The maximum value for *n* was increased from 1023 to 2047.
@@ -1176,6 +1218,8 @@ Window objects
11761218
If *flag* is ``True``, escape sequences generated by some keys (keypad, function keys)
11771219
will be interpreted by :mod:`!curses`. If *flag* is ``False``, escape sequences will be
11781220
left as is in the input stream.
1221+
Keypad mode is disabled by default, but :func:`wrapper` enables it for the
1222+
main window.
11791223

11801224

11811225
.. method:: window.leaveok(flag)
@@ -1528,6 +1572,8 @@ by some methods.
15281572
| | color-pair field information |
15291573
+-------------------------+-------------------------------+
15301574

1575+
.. _curses-key-constants:
1576+
15311577
Keys are referred to by integer constants with names starting with ``KEY_``.
15321578
The exact keycaps available are system dependent.
15331579

pr-preview/pr-1231/_sources/library/zlib.rst.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The available exception and functions in this module are:
2727
Exception raised on compression and decompression errors.
2828

2929

30-
.. function:: adler32(data[, value])
30+
.. function:: adler32(data, value=1, /)
3131

3232
Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
3333
reliable as a CRC32 but can be computed much more quickly.) The result
@@ -113,7 +113,7 @@ The available exception and functions in this module are:
113113
Added the *zdict* parameter and keyword argument support.
114114

115115

116-
.. function:: crc32(data[, value])
116+
.. function:: crc32(data, value=0, /)
117117

118118
.. index::
119119
single: Cyclic Redundancy Check
@@ -177,7 +177,7 @@ The available exception and functions in this module are:
177177
.. versionchanged:: 3.6
178178
*wbits* and *bufsize* can be used as keyword arguments.
179179

180-
.. function:: decompressobj(wbits=MAX_WBITS[, zdict])
180+
.. function:: decompressobj(wbits=MAX_WBITS, zdict=b'')
181181

182182
Returns a decompression object, to be used for decompressing data streams that
183183
won't fit into memory at once.
@@ -203,15 +203,15 @@ The available exception and functions in this module are:
203203
Compression objects support the following methods:
204204

205205

206-
.. method:: Compress.compress(data)
206+
.. method:: Compress.compress(data, /)
207207

208208
Compress *data*, returning a bytes object containing compressed data for at least
209209
part of the data in *data*. This data should be concatenated to the output
210210
produced by any preceding calls to the :meth:`compress` method. Some input may
211211
be kept in internal buffers for later processing.
212212

213213

214-
.. method:: Compress.flush([mode])
214+
.. method:: Compress.flush(mode=Z_FINISH, /)
215215

216216
All pending input is processed, and a bytes object containing the remaining compressed
217217
output is returned. *mode* can be selected from the constants
@@ -266,7 +266,7 @@ Decompression objects support the following methods and attributes:
266266
.. versionadded:: 3.3
267267

268268

269-
.. method:: Decompress.decompress(data, max_length=0)
269+
.. method:: Decompress.decompress(data, /, max_length=0)
270270

271271
Decompress *data*, returning a bytes object containing the uncompressed data
272272
corresponding to at least part of the data in *string*. This data should be
@@ -285,7 +285,7 @@ Decompression objects support the following methods and attributes:
285285
*max_length* can be used as a keyword argument.
286286

287287

288-
.. method:: Decompress.flush([length])
288+
.. method:: Decompress.flush(length=DEF_BUF_SIZE, /)
289289

290290
All pending input is processed, and a bytes object containing the remaining
291291
uncompressed output is returned. After calling :meth:`flush`, the

pr-preview/pr-1231/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-
最後更新於 8月 23, 2026 (00:17 UTC)。
359+
最後更新於 8月 24, 2026 (00:16 UTC)。
360360

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

pr-preview/pr-1231/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://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
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>
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-
最後更新於 8月 23, 2026 (00:17 UTC)。
396+
最後更新於 8月 24, 2026 (00:16 UTC)。
397397

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

pr-preview/pr-1231/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-
最後更新於 8月 23, 2026 (00:17 UTC)。
368+
最後更新於 8月 24, 2026 (00:16 UTC)。
369369

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 8月 23, 2026 (00:17 UTC)。
580+
最後更新於 8月 24, 2026 (00:16 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1231/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-
最後更新於 8月 23, 2026 (00:17 UTC)。
517+
最後更新於 8月 24, 2026 (00:16 UTC)。
518518

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ <h3>導航</h3>
10011001
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10021002
<br>
10031003
<br>
1004-
最後更新於 8月 23, 2026 (00:17 UTC)。
1004+
最後更新於 8月 24, 2026 (00:16 UTC)。
10051005

10061006
<a href="/bugs.html">發現 bug</a>
10071007

0 commit comments

Comments
 (0)